sstur / react-rte

Pure React rich text WYSIWYG editor based on draft-js.
https://react-rte.org
ISC License
2.86k stars 431 forks source link

Window is not defined error when run from Next #454

Open AkshayBenny opened 1 year ago

AkshayBenny commented 1 year ago

ReferenceError: window is not defined node_modules/react-rte/dist/react-rte.js:1:74280

MrCrafty commented 1 year ago

This is because window is not loaded and the code is trying to get it.

You can try it with this:

if (typeof window !== "undefined") {
  // Client-side-only code
}
rohit267 commented 4 months ago

still has the error on pages router