Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for React SSR #7

Closed
gbhrdt opened this issue Aug 7, 2016 · 2 comments
Closed

Support for React SSR #7

gbhrdt opened this issue Aug 7, 2016 · 2 comments
Labels

Comments

@gbhrdt
Copy link

gbhrdt commented Aug 7, 2016

Hi, nice component, but it does not seem to work with React server-side rendering, as it uses the window object, which is only available on the client.

ReferenceError: window is not defined
  at Object.get (/node_modules/emoji-mart/dist/emoji-mart.js:919:28)
  at Object.defineProperty.value (/node_modules/emoji-mart/dist/emoji-mart.js:865:35)
  at __webpack_require__ (/node_modules/emoji-mart/dist/emoji-mart.js:30:30)
  at Object.defineProperty.value (/node_modules/emoji-mart/dist/emoji-mart.js:609:20)
  at __webpack_require__ (/node_modules/emoji-mart/dist/emoji-mart.js:30:30)
  at Object.defineProperty.value (/node_modules/emoji-mart/dist/emoji-mart.js:116:18)
  at __webpack_require__ (/node_modules/emoji-mart/dist/emoji-mart.js:30:30)
  at Object.defineProperty.value /node_modules/emoji-mart/dist/emoji-mart.js:64:20)
  at __webpack_require__ (/node_modules/emoji-mart/dist/emoji-mart.js:30:30)
  at Object.defineProperty.value (/node_modules/emoji-mart/dist/emoji-mart.js:50:18)
@baptisteArno
Copy link

baptisteArno commented May 13, 2022

I've upgraded to React 18 and emoji-mart to 5.0.0, it seems this bug is happening again

Server Error
ReferenceError: window is not defined

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
/node_modules/emoji-mart/dist/index.js (1102:56)
ModuleJob.run
internal/modules/esm/module_job.js (183:25)
async Loader.import
internal/modules/esm/loader.js (178:24)

@EtienneLem
Copy link
Member

See #575 , will add documentation soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants