bigcommerce/checkout-sdk-js

Unexpected token process.env.NODE_ENV

Closed this issue · 3 comments

I'm currently using Vite, but during rollup im getting an unexpected token error. This is regarding the warning text in file create-checkout-service.ts on line 95.

getDefaultLogger().warn(
    'Note that the development build is not optimized. To create a production build, set process.env.NODE_ENV to `production`.',
);

When I remove the "process.env.NODE_ENV" text it will build just fine.

Could you kindly provide your question?

Hey @ShuCh3n are you building SDK locally for dev? Where are you removing the text from?

Screenshot 2023-08-22 at 16 52 35

@animesh1987 It Doesn't matter for which build, either dev or production both are giving me this error. I suspect that Vite replaces the process.env.NODE_ENV. So when I remove this part of text in node_modules/@bigcommerce/checkout-sdk/dist/checkout-sdk.js it will build just fine.