jpuri / react-draft-wysiwyg

A Wysiwyg editor build on top of ReactJS and DraftJS. https://jpuri.github.io/react-draft-wysiwyg
MIT License
6.42k stars 1.16k forks source link

Global is not defined #1092

Open raphael10-collab opened 3 years ago

raphael10-collab commented 3 years ago

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
jarretmoses commented 3 years ago

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

lowzijian commented 3 years ago

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

Cyril-AL commented 2 years ago

Have you found a solution

mikealessi24 commented 2 years ago

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

hisreal123 commented 1 year ago

yeah, this fixed it for me. Thanks

otnansirk commented 10 months ago

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

in laravel with inertiajs(reactjs) ?

otnansirk commented 10 months ago

Solved : in laravel with inertiajs (reactjs)

add

window.global = window;

to end of file resources/js/bootstrap.js