ReferenceError: window is not defined
See original GitHub issuewindow
is undefined in code-runner. This is native code in browsers so it should be defined in code-runner.
I realise it doesn’t have a browser window to reference but it could maybe use the editor window as a reference point instead. If that’s not possible then using a generic fixed screen size for the sake of testing would be good enough to work with.
window
should have all (or at least as many as possible) of the same values that can be found in a standard unmodified window object found in a modern browser.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to solve "window is not defined" errors in React and Next.js
First solution: typeof Because typeof won't try to evaluate "window", it will only try to get its type, in our case in Node....
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 ...
Well, that file seems to be running on the server, not the browser, and there is no window on the server? Node does...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Use global instead
By default, Code Runner use Node.js to run JavaScript code, while Node.js not support
window
. You could choose other executor as you like.