coston / react-super-responsive-table

Turn the tables on unresponsive data!
https://react-super-responsive-table.vercel.app
MIT License
430 stars 50 forks source link

Error: Global is Not define [Solution] #636

Open pantharshit007 opened 3 weeks ago

pantharshit007 commented 3 weeks ago

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 commented 3 weeks ago

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