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.

document is not defined

See original GitHub issue

Hi 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:closed
  • Created 8 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mrinterwebcommented, Mar 7, 2016

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.

0reactions
knownasilyacommented, Dec 11, 2022

Repro https://github.com/knownasilya/fastboot-dev-require-repro (note how it’s importing dev versions of modules)

Read more comments on GitHub >

github_iconTop 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 >

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