react-draft-wysiwyg icon indicating copy to clipboard operation
react-draft-wysiwyg copied to clipboard

Global is not defined

Open raphael10-collab opened this issue 3 years ago • 7 comments

In my Electron-React-Typescript-Webpack app I just installed react-draft-wysuwyg

In the renderer I've put:

export default function Funct() {
    import { Editor } from "react-draft-wysiwyg";
    import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";

    return (
      <Editor />
    )
}

I get this error in the console.log :

Global is not defined

raphael10-collab avatar Mar 30 '21 18:03 raphael10-collab

@raphael10-collab did you end up resolving this? If so how?

jarretmoses avatar Oct 17 '21 15:10 jarretmoses

I face the same issue , any idea on how to fix it , which version should i fallback to ?

lowzijian avatar Nov 04 '21 10:11 lowzijian

Have you found a solution

Cyril-AL avatar Jun 08 '22 07:06 Cyril-AL

Add this to your index.html

<script> global = globalThis </script>

https://stackoverflow.com/questions/58936238/uncaught-referenceerror-global-is-not-defined-at-object-node-modules-fbjs-lib

mikealessi24 avatar Jun 29 '22 16:06 mikealessi24

yeah, this fixed it for me. Thanks

hisreal123 avatar May 20 '23 20:05 hisreal123

Where to add this script <script> global = globalThis </script>

in laravel with inertiajs(reactjs) ?

otnansirk avatar Jan 17 '24 06:01 otnansirk

Solved : in laravel with inertiajs (reactjs)

add

window.global = window;

to end of file resources/js/bootstrap.js

otnansirk avatar Jan 17 '24 06:01 otnansirk