Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Global is Not define [Solution] #636

Open
pantharshit007 opened this issue Jun 5, 2024 · 1 comment
Open

Error: Global is Not define [Solution] #636

pantharshit007 opened this issue Jun 5, 2024 · 1 comment
Labels

Comments

@pantharshit007
Copy link

pantharshit007 commented Jun 5, 2024

Describe the bug
I got an error like the one mention in the screenshot below in the react VITE project. I did exactly the same steps that are mentioned in the official npm site.

here global is deprecated and we need to use globalThis instead

Screenshots
image
image

SOLUTION IS IN THE BELOW COMMENT UNLIKE ISSUE #552

@pantharshit007
Copy link
Author

JUST ADD THIS LINE IN YOUR vite.config.js file

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  define: {
    global: "globalThis",
  }
})

this is the important part

define: {
    global: "globalThis",
  }

SOURCE: here
react-simple-code-editor/react-simple-code-editor#86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant