Hey :man-raising-hand::skin-tone-2: I’m getting a ...
# ask-questions
v
Hey 🙋🏻‍♂️ I’m getting a “process is not defined” error when using the Javascript SDK in the browser.
process
is obviously not defined in browsers, am I missing something?
f
Are you using a bundler for your javascript? Most of them remove those lines automatically during the build process. We have them so when you do a dev build (
NODE_ENV=development
), we include much more verbose logging while keeping the production build small.
v
Using
tsc
and
rollup
f
Ok. Most rollup configs have that already by default, but it's possible yours is missing that step.
Copy code
plugins: [
    replace({
      "process.env.NODE_ENV": JSON.stringify("production"),
      preventAssignment: true,
    }),
  ]
v
Thanks! that solved it