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.

Is there any way to avoid errors on server side?

See original GitHub issue

I’m trying to implement an isomorphic render, including Draft.js + draft-convert. Client-side works fine, but I’m facing a problem on server-side.

/src/utils/parseHTML.js contains a function fallback() which using document. Of course there is no document when you on server-side, so the question is – how to avoid that problem?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

8reactions
mwickettcommented, Oct 30, 2017

I’m trying to convert some HTML content as we migrate from an old platform to a new client app using draft-js, and I’m having difficulty understanding how to use this in a Node script. Specifically, I keep getting document not defined, even when passing in jsdom.

0reactions
benbriggscommented, Apr 27, 2017

Closing this as I believe using jsdom should fit the usecase - it’s what the tests use when running in jest

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging and error management best practices in SSR apps
Handle errors and log them gracefully in your next web app with these best practice guidelines with examples using Next.js and Nuxt.js.
Read more >
Handling runtime errors when server side rendering with Next.js
It's best to use a mix of optional chaining and try catch to avoid server side errors. Avoid falling into the trap of...
Read more >
How to Prevent Server Error Messages Disclosure
Another method is the proper input sanitization. Often errors caused in the application are because of some unsupported characters such as ” ”...
Read more >
What's the best way to deal with an error in the server side and ...
Yes, the data didn't load message on the server side would be a good idea to start with.
Read more >
What are server side errors? - Branding Questions and Answers
Server side errors can be caused by a variety of factors, including problems with the server itself, issues with the web server software,...
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