question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceError: window is not defined

See original GitHub issue

From the latest version: 0.71.5, server-side rendering produces following issue

/var/app/current/node_modules/semantic-ui-react/dist/commonjs/behaviors/Visibility/Visibility.js:260
  context: window,
           ^
ReferenceError: window is not defined
    at Object.<anonymous> (/var/app/current/node_modules/semantic-ui-react/dist/commonjs/behaviors/Visibility/Visibility.js:260:12)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/var/app/current/node_modules/semantic-ui-react/dist/commonjs/behaviors/Visibility/index.js:8:19)
    at Module._compile (module.js:569:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! snowy-console@1.0.0 start: `NODE_ENV=production node build/server`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the snowy-console@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:24
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

10reactions
levithomasoncommented, Aug 28, 2017

I do my best to make a release every weekend. Sometimes I don’t cause of life and free software 😃

5reactions
lottamuscommented, Aug 21, 2017

Looks like the issue is coming from this commit: https://github.com/Semantic-Org/Semantic-UI-React/commit/e350886fbaad1f696b02cdd00b92852c5713df6f

Perhaps we should wrap the defaultProps “context”: window with an “isBrowser” check

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve "window is not defined" errors in React and Next.js
How to solve "window is not defined" errors in React and Next.js · 1. First solution: typeof · 2. Second solution: the useEffect...
Read more >
referenceerror: window is not defined, how to solve
Here's how to fix the “referenceerror: window is not defined” error that you might have in Node.js or with a tool like Next.js....
Read more >
[Solved] ReferenceError : window is not defined - ItsJavaScript
The ReferenceError : window is not defined error mainly occurs if you are using the window object in Node.js, React.js, Next.js.
Read more >
How To Solve ReferenceError window is not defined in ...
Fixing a window is not defined error can be quite simple. In most cases, all you will need to do is wrap your...
Read more >
ReferenceError : window is not defined at object. <anonymous ...
window is a browser thing that doesn't exist on Node.js, but ES2020 introduced globalThis , which (being part of the JavaScript ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found