Is there any way to avoid errors on server side?
See original GitHub issueI’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:
- Created 7 years ago
- Comments:5
Top 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 >
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 Free
Top 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
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 injsdom
.Closing this as I believe using
jsdom
should fit the usecase - it’s what the tests use when running in jest