-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
SSR can't resolve builtin modules that start with underscore #5826
Comments
See discussion in #5809 (comment) about this issue |
Based on the discussion and the code, I think it had always been a bug in Vite and is not a regression. Unless this used to work in prior Vite versions? |
its mentioned in #5709 that it used to work in 2.6.14 |
I took a look at why |
I think we should add it, it is good that our isBuiltin is in sync with esbuild harcoded list |
I found about this trying to make I'm not really sure what's going on, maybe some other bug was causing |
Describe the bug
Some packages (like
@prisma/client
) require the builtin_http_common
module (or others that start with an underscore) which causesssrLoadModule
to throwError: Cannot find module '_http_common' imported from ...
error. It seems to be caused by thebuiltin-modules
package that Vite uses for this purpose filtering out modules that start with an underscore (changing the relevant regex in the transpiled code fixes the problem).Reproduction
node ssr-module.mjs
works butnode .
throws trying to load the same module withssrLoadModule
.System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: