Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next.js compatibility #49

Closed
SavSidorov opened this issue Jun 30, 2022 · 1 comment
Closed

Next.js compatibility #49

SavSidorov opened this issue Jun 30, 2022 · 1 comment

Comments

@SavSidorov
Copy link

I'm trying to use react–mathquill with Next.js, and am running into an issue: "ReferenceError: window is not defined" with a stack trace to mathquill.js.

Are there any workarounds to this? Maybe lazy loading with no SSR?

@viktorstrate
Copy link
Owner

I don't think it will be possible to make Mathquill work with SSR.

Maybe dynamic imports can be used to import the package.
https://nextjs.org/docs/advanced-features/dynamic-import#with-no-ssr

Then remember to call addStyles() when the import promise has resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants