-
Notifications
You must be signed in to change notification settings - Fork 3
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
Import error when using in NextJS #206
Comments
Are you using any sort of bundler? (Webpack, vite,...). I would not expect ES Modules (import / export syntax) to work well without a bundler.1. I would recommend using vite.. Footnotes
|
Hey,
Yes i am actually using Next JS and I believe it uses webpack 5 as the default
|
Do you have a repository you can share? I’ve never used NextJS but I’m happy to try and look into it. (Might take me a few days to find the time) |
Yeah, I've shared the private repository with you. You can find the relevant code under ./pages/mideo-3.js. |
@Abhimanyu-Jha Everything seemed to work fine for me after |
Yeah, but after you refresh the page, or make any changes in the file and save the file, it it shows the error and there's no way to remove it. |
My experience was that:
As mentioned, I am not a next-js expert, but comments like this make me wonder if this is related to SSR in NextJS. My understanding is that when loading localhost:3000/mideo-3, NextJS tries to render that page on the server before serving it to you. It seems reasonable to me that mathbox wouldn't work great with SSR since it relies on a bunch of browser APIs. |
Thanks for the help, this works as expected in vite 👌🏻 |
Hey, trying to run setup this library for use. I've yarn added
The page seems to open to this error in the mathbox module. Are there any fixes/ workarounds for this?
The text was updated successfully, but these errors were encountered: