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

window is undefined #7

Open
jeffriandriyanto opened this issue Nov 2, 2018 · 3 comments
Open

window is undefined #7

jeffriandriyanto opened this issue Nov 2, 2018 · 3 comments
Labels
Status: Review Needed Type: Bug Something isn't working

Comments

@jeffriandriyanto
Copy link

jeffriandriyanto commented Nov 2, 2018

i think this is about server side rendering. but i can't solve this.
can you guys tell me how to fixing this issue?

thank you.

@jeffriandriyanto jeffriandriyanto changed the title [nodemon] app crashed - waiting for file changes before starting... a Nov 2, 2018
@jeffriandriyanto jeffriandriyanto changed the title a window is undefined Nov 2, 2018
@swashata
Copy link
Member

swashata commented Nov 2, 2018

Hello,

This is definitely because of SSR. Can you put the complete trace here? If possible a repo with reproducing error? Would help me debug it.

@swashata swashata added Type: Bug Something isn't working Status: Review Needed labels Nov 2, 2018
@jeffriandriyanto
Copy link
Author

ReferenceError: window is not defined
    at Object.<anonymous> (/home/*/*/*/*/node_modules/@fonticonpicker/react-fonticonpicker/dist/webpack:/FontIconPicker/webpack/universalModuleDefinition:10:2)
    at Module._compile (module.js:653:30)
    at Module._extensions..js (module.js:664:10)
    at Object.require.extensions.(anonymous function) [as .js] /home/*/*/*/*/node_modules/babel-register/lib/node.js:152:7)
   etc ...

i hope it can help solve this issue. thank you

@davidgolden
Copy link

This can be solved with something like:

if (window) { const FontIconPicker = require("@fonticonpicker/react-fonticonpicker"); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants