Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Dynamic import required with SSR, not necessary #2

Open
MatthewCaseres opened this issue Nov 12, 2020 · 0 comments
Open

Dynamic import required with SSR, not necessary #2

MatthewCaseres opened this issue Nov 12, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@MatthewCaseres
Copy link
Owner

When monacoEditor.tsx imports ConsoleLog it causes error "document not defined". In the version of this package that is not on npm (the npm component grew out of a component from a NextJS project) this is solved with using a dynamic import via "next/dynamic".

I tried some hacks to make this work a while ago, not sure what the solution is. I had some wacky if(window){const ConsoleLog = require("./ConsoleLog")} or something like that, but TSDX didn't like it and maybe it just wasn't a good way of doing things.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant