-
Notifications
You must be signed in to change notification settings - Fork 686
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
[Vue/Vite/Nuxt] Build Error: require is not defined in ES module scope, you can use import instead #353
Comments
Same error on my SvelteKit + Vite project |
Having a langchain integration would be fantastic for web-llm. Bumping the issue. |
3 tasks
It works after disabling SSR |
This error should be addressed in npm 0.2.36. For details please see #397. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Problem
Using
web-llm
in a Nuxt project results in an import error during build.This seems to relate to ES module / CommonJS import conflicts.
(Temporary) Solution
In
nuxt.config.ts
, add the build transpile option:and change import statements like the following:
However, this does seem to be an abnormal behavior that still needs to be resolved.
Related Issues
#140
Notes
I don't have expertise in JavaScript/Vue/Nuxt to fully understand what is going on, so please add any other helpful notes!
Feel free to close this, or keep until the error doesn't occur by default
The text was updated successfully, but these errors were encountered: