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

Description

v.0.3.0 in a razzlejs build with ssr balks when I add remirror editor to the mix. The renderer is working just fine.

ReferenceError: document is not defined
    at createCache (/Volumes/Data/razzle-demo/node_modules/@remirror/react-ssr/lib/dist/react-ssr.esm.js:1191:1)
    at Module.../node_modules/@remirror/react-ssr/lib/dist/react-ssr.esm.js (/Volumes/Data/razzle-demo/build/webpack:/node_modules/@remirror/react-ssr/lib/dist/react-ssr.esm.js:1696:1)

Possible Fix

🤷‍♂ I can’t find any reference to document in the codebase so I don’t know what’s going on.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
ifiokjrcommented, Jul 21, 2019

@hennessyevan I’ve managed to find a fix for this. It’ll be available in the next release.

It’s a sneaky one and would likely have caused a lot of issues down the line so I appreciate you raising it.

I’ve added a brief explanation to #115 in case your interested 👍

1reaction
hennessyevancommented, Jul 22, 2019

Fantastic!

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

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