supertokens-auth-react icon indicating copy to clipboard operation
supertokens-auth-react copied to clipboard

global is not defined error

Open kali-kb opened this issue 3 years ago • 1 comments

I followed the guide every bit of the instruction there but somehow I get this "global is not defined" error and I couldn't figure out what the problem is can somebody help? I'm using react v17.0.2 if it has anything to do with it thanks in advance.

kali-kb avatar Apr 05 '22 16:04 kali-kb

Are you using Vite?

If so try adding the below to vite.config.ts:

  return defineConfig({
    ...
    define: {
      global: {}
    },
    ...

If not, that error is related to a React PropTypes check, so you could try disabling that or defining global in whatever build chain you are using.

anmilleriii avatar Apr 06 '22 00:04 anmilleriii