ealush / emoji-picker-react

The most popular React Emoji Picker
https://ealush.com/emoji-picker-react/
MIT License
1.04k stars 171 forks source link

Emoji Picker Issue: global not defined #335

Closed KartikeyKakaria closed 1 year ago

KartikeyKakaria commented 1 year ago

I wanna use the emoji picker extension, but it bugs my whole app and gives this error Uncaught ReferenceError: global is not defined js http://localhost:8000/node_modules/.vite/deps/emoji-picker-react.js?v=7919ba0a:13 http://localhost:8000/node_modules/.vite/deps/chunk-DFKQJ226.js?v=7919ba0a:8

http://localhost:8000/node_modules/.vite/deps/emoji-picker-react.js?v=7919ba0a:1242
ealush commented 1 year ago

See troubleshooting section in the docs.

KartikeyKakaria commented 1 year ago

Thanks 👍

murilogoedert commented 1 year ago

Is there a way around this without having to define an additional script tag with "window.global"?

in my case I have a chat application that is embedded in third party sites, in this case I would like to be able to generate just one embed script for my clients to embed my chat, this way my embed code needs two script tags to work properly, one for the bundled code on cdn and another for creating window.global.

I've tried to create the global var on my app code, but without success.

UPDATE:

found it, for those with the same problem: https://github.com/ealush/emoji-picker-react/issues/202#issuecomment-1137410593