-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Incorrect SSR error when importing package with incorrect import paths #12322
Labels
Comments
bluwy
added
p3-minor-bug
An edge case that only affects very specific usage (priority)
feat: ssr
labels
Mar 7, 2023
Start a new pull request in StackBlitz Codeflow. |
sun0day
added a commit
to sun0day/vite
that referenced
this issue
Mar 7, 2023
9 tasks
Update: I realized now why the local package repro had a better error message. Because the |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Describe the bug
When importing a package in SSR that would've error-ed in node too, Vite swallows the node error, and shims the module as
undefined
instead, causing hard-to-debugCannot read properties of undefined
errors.It would be good to surface the errors directly. It seems to be swallowed at
vite/packages/vite/src/node/ssr/ssrModuleLoader.ts
Line 260 in ce18eba
(Discovered through withastro/astro#6403)
Reproduction
https://stackblitz.com/edit/bluwy-create-vite-extra-56u3yb?file=src%2Fmain.js,test.js
Steps to reproduce
Run
node test.js
. Seemain.js
to see the file that gets loaded with comments of why it's erroring.System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: