vite
vite copied to clipboard
Improve developer experience by changing message "failed to load module for ssr"
Description
As an indirect user of Vite by using Astro, I would like the failed to load module for ssr
to express why the module failed to load.
I believe there are multiple conditions that can trigger this - the one I experience often is a wrong path to a file. It's only through past experience of this error that I know, in my case at least, that this usually means the file was not found.
Suggested solution
https://github.com/vitejs/vite/blob/3a586e4818ed0bd1d6974dc6718fe5ea44b72bd7/packages/vite/src/node/ssr/ssrModuleLoader.ts#L87-L93
Complete the TODO
and display a more informative message stating why the module failed to load.
Alternative
No response
Additional context
No response
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Hi, can you provide a repro to test this one out? I tried to bring this edgecase out in the past but couldn't get it to reach the error.
Repro: https://stackblitz.com/edit/github-ad1c93?file=test.js