document is not defined
See original GitHub issueHi there! I have a problem:
ember fastboot --serve-assets
version: 1.13.8
Built project successfully. Stored in "fastboot-dist".
DEPRECATION: `ember-cli/lib/errors/silent.js` is deprecated, use `silent-error` instead.
DEPRECATION: `ember-cli/lib/errors/silent.js` is deprecated, use `silent-error` instead.
DEPRECATION: `ember-cli/lib/errors/silent.js` is deprecated, use `silent-error` instead.
document is not defined
ReferenceError: document is not defined
at <anonymous>:139924:54
at <anonymous>:136465:9
at <anonymous>:136467:2
Can you help me?
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
ReferenceError: document is not defined (in plain JavaScript)
Explanation: The error is caused because NextJs renders the page in the server only and in the server document (document is used inside...
Read more >ReferenceError: document is not defined in JavaScript
The "ReferenceError: document is not defined" error is thrown when the code tries to access the document object, but the object is not ......
Read more >How to fix ReferenceError: Document is not defined ... - Sabe.io
The most common reason for getting the reference error while on the browser is when you try to access the document object too...
Read more >How to solve the document is not defined error - Flavio Copes
Here's how to fix the “referenceerror: document is not defined” error that you might have in Node.js or with a tool like Next.js....
Read more >ReferenceError: document is not defined in JavaScript
The "ReferenceError: document is not defined" error occurs for multiple reasons: ... The document relates to the document object which represents a web...
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
I’m running into the same issue. Many, maybe even most, ember applications are going to run into this problem with some 3rd party library eventually. I don’t know if it is possible to catch exceptions related to document or window not being available. Maybe there is a way to mock the global document and window objects, but I have a feeling that would be very difficult to decently mock.
Just quickly googling around, I found this https://github.com/darrylwest/mock-browser. I have no idea if that would be helpful.
I don’t know if this issue should be closed. It is something, I think, that will need to be addressed before fastboot can be a viable solution for many Ember applications.
Repro https://github.com/knownasilya/fastboot-dev-require-repro (note how it’s importing dev versions of modules)