react-super-responsive-table icon indicating copy to clipboard operation
react-super-responsive-table copied to clipboard

Error: Global is Not define [Solution]

Open pantharshit007 opened this issue 1 year ago • 1 comments

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 avatar Jun 05 '24 19:06 pantharshit007

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 https://github.com/react-simple-code-editor/react-simple-code-editor/issues/86

pantharshit007 avatar Jun 05 '24 19:06 pantharshit007

This issue is resolved

coston avatar Aug 20 '24 15:08 coston