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.

Problems with server-side rendering. Navigator is not defined

See original GitHub issue

This component is actually cannot work with server-side rendering applications. And throws error looks like ReferenceError: navigator is not defined It’s a problem with codemirror component which is dependency of original simplemde project. I already have a proven workaround which is used in react-codemirror project. PR request will be in a few minutes.

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
RIP21commented, Jan 29, 2022

@pdichone

import dynamic from 'next/dynamic'
const SimpleMDE = dynamic(() => import('react-simplemde-editor'), { ssr: false })

Then render as usual wherever you want.

4reactions
pdichonecommented, Jan 31, 2022

@RIP21 Thnak you a bunch!! It works! Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server-side rendering: "ReferenceError: navigator is not defined"
When I include this module in one of my views that I render on the server (using React here), I get the ReferenceError...
Read more >
navigator is not defined in angular4 with server side rendering ...
Another solution is to use webpack to handle those browser objects. something like this ref module: { rules: [ { test: /@angular(\\ ...
Read more >
Server Side Rendered React throws `navigator is not defined`
Running locally the scheduler works as expected but when deployed the schedulers breaks the application with the following log output:.
Read more >
navigator is not defined react - You.com | The AI Search ...
If you're doing server side rendering then you need to call navigator in a function that is run on the client side. For...
Read more >
Getting "ReferenceError: navigator is not defined" in Next.js app
Getting error - ReferenceError: navigator is not defined error from ... -dom-server.node.production.min.js:36:16) 3:18:27 PM: at a.b.render ...
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