grapesjs-component-code-editor icon indicating copy to clipboard operation
grapesjs-component-code-editor copied to clipboard

window is not defined

Open johann-taberlet opened this issue 2 years ago • 0 comments

Hey there, first I would like to thank you for all your amazing plugins.

I'm fairly new with Grapes and I don't really understand what's happening with this plugin. I'm in a next.js context and I initiate the editor inside a useEffect hook, so normally I am assured that the code is executed on the client side but even with this, when I use this plugin I'm facing a "window is not defined" error. I double checked with a test typeof window !== "undefined" before the editor init but doesn't fixed anything. If I remove the plugin from the editor, I have no more errors. If I just use the hot reload when I add it, it works pretty well. But if I refresh the page or if I try to run a build it fails.

Does anyone have an idea of the issue here ?

SCR-20230208-p96

johann-taberlet avatar Feb 08 '23 17:02 johann-taberlet