You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a create-react-app application and I wanted to use amazing react-select. It works while its on my localhost but when I push it to herokuapp online (production mode) I get the error that the window isnt defiend.
/app/build/static/node_modules/react-select/dist/Select-9fdb8cd0.browser.esm.js:495 2020-03-31T13:00:00.222254+00:00 app[web.1]: return 'ontouchstart' in window || navigator.maxTouchPoints; 2020-03-31T13:00:00.222254+00:00 app[web.1]: ^ 2020-03-31T13:00:00.222315+00:00 app[web.1]: ReferenceError: window is not defined 2020-03-31T13:00:00.222316+00:00 app[web.1]: at Object.<anonymous> (/app/build/static/node_modules/react-select/dist/Select-9fdb8cd0.browser.esm.js:495:3) 2020-03-31T13:00:00.222316+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.222317+00:00 app[web.1]: at Object.<anonymous> (/app/build/static/js/main.34f02a46.js:1:444330) 2020-03-31T13:00:00.222317+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.222318+00:00 app[web.1]: at Object.<anonymous> (/app/build/static/js/main.34f02a46.js:1:426715) 2020-03-31T13:00:00.222318+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.222319+00:00 app[web.1]: at Module.compose (/app/build/static/js/store.js:19:9) 2020-03-31T13:00:00.222319+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.222319+00:00 app[web.1]: at Object.<anonymous> (/app/build/static/js/main.34f02a46.js:1:1830012) 2020-03-31T13:00:00.222320+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.240453+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2020-03-31T13:00:00.240812+00:00 app[web.1]: npm ERR! errno 1 2020-03-31T13:00:00.242218+00:00 app[web.1]: npm ERR! app@4.4.0 start:node --icu-data-dir=node_modules/full-icu server/index.js 2020-03-31T13:00:00.242364+00:00 app[web.1]: npm ERR! Exit status 1 2020-03-31T13:00:00.242540+00:00 app[web.1]: npm ERR! 2020-03-31T13:00:00.242672+00:00 app[web.1]: npm ERR! Failed at the app@4.4.0 start script. 2020-03-31T13:00:00.242798+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Can someone please tell me what is the workaround for this? Or I can't use react-select in SSR?
How can I define window object?
The text was updated successfully, but these errors were encountered:
Hi @AleksaCorona, as mentioned by @teltploek, this issue has been outlined in #3802. I'm going to close this for now so we can keep the issues streamlined.
Hello!
I have a create-react-app application and I wanted to use amazing react-select. It works while its on my localhost but when I push it to herokuapp online (production mode) I get the error that the window isnt defiend.
/app/build/static/node_modules/react-select/dist/Select-9fdb8cd0.browser.esm.js:495 2020-03-31T13:00:00.222254+00:00 app[web.1]: return 'ontouchstart' in window || navigator.maxTouchPoints; 2020-03-31T13:00:00.222254+00:00 app[web.1]: ^ 2020-03-31T13:00:00.222315+00:00 app[web.1]: ReferenceError: window is not defined 2020-03-31T13:00:00.222316+00:00 app[web.1]: at Object.<anonymous> (/app/build/static/node_modules/react-select/dist/Select-9fdb8cd0.browser.esm.js:495:3) 2020-03-31T13:00:00.222316+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.222317+00:00 app[web.1]: at Object.<anonymous> (/app/build/static/js/main.34f02a46.js:1:444330) 2020-03-31T13:00:00.222317+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.222318+00:00 app[web.1]: at Object.<anonymous> (/app/build/static/js/main.34f02a46.js:1:426715) 2020-03-31T13:00:00.222318+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.222319+00:00 app[web.1]: at Module.compose (/app/build/static/js/store.js:19:9) 2020-03-31T13:00:00.222319+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.222319+00:00 app[web.1]: at Object.<anonymous> (/app/build/static/js/main.34f02a46.js:1:1830012) 2020-03-31T13:00:00.222320+00:00 app[web.1]: at n (/app/build/static/webpack/bootstrap:9:5) 2020-03-31T13:00:00.240453+00:00 app[web.1]: npm ERR! code ELIFECYCLE 2020-03-31T13:00:00.240812+00:00 app[web.1]: npm ERR! errno 1 2020-03-31T13:00:00.242218+00:00 app[web.1]: npm ERR! app@4.4.0 start:
node --icu-data-dir=node_modules/full-icu server/index.js2020-03-31T13:00:00.242364+00:00 app[web.1]: npm ERR! Exit status 1 2020-03-31T13:00:00.242540+00:00 app[web.1]: npm ERR! 2020-03-31T13:00:00.242672+00:00 app[web.1]: npm ERR! Failed at the app@4.4.0 start script. 2020-03-31T13:00:00.242798+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Can someone please tell me what is the workaround for this? Or I can't use react-select in SSR?
How can I define window object?
The text was updated successfully, but these errors were encountered: