-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ReferenceError: require is not defined #655
Comments
Could be related to vitejs/vite#2579 & vitejs/vite#2667 |
I do not think those issues are related Can you try adding this to |
Both suggestions don't to work. What does work is dropping |
The SvelteKit starter comes with this line Update: reason |
Moving these deps do |
It's because Vite will try to optimize It's also possible that #759 would have fixed this I'm going to close this since it sounds like putting them in |
I'm not sure if this is right place to comment and please correct me if I have done this wrong but I am having a very similar issue. If I don't include "cookie" in my noExternal in svelte.config.cjs and I try and run a npm run build to Vercel, I get errors on build as below; It makes no difference if cookie is in package.json as either a dependencies or devDependencies. If I have "cookie" in my noExternal then I can run a successful Vercel build but when pnpm run dev on my local I get errors from vite as below; |
I believe issues with the |
@benmccann, same problem with faunadb - the database of netlify. This issue should not be considered as closed. Even the build command fails with
I tracked down the issue: Sice faunadb is the db for netlify, this is a show stopper at this point :( |
Issues with loading various modules should generally be filed over at https://github.com/vitejs/vite since that's where the issue is coming from and there's not much we can do within SvelteKit to address it |
Describe the bug
[vite] Error when evaluating SSR module /node_modules/gray-matter/index.js: ReferenceError: require is not defined
Logs
To Reproduce
Svelte:
^3.29.0
SvelteKit:
^1.0.0-next.55
repository:https://github.com/PingTouG/svelte-kit-demo
The text was updated successfully, but these errors were encountered: