Dynamic import error doesn't have error code ERR_MODULE_NOT_FOUND
#6699
Labels
p2-to-be-discussed
Enhancement under consideration (priority)
ERR_MODULE_NOT_FOUND
#6699
Describe the bug
For this code:
On Node
On Vitest
It looks like this was brought up previously in #326. It doesn't throw during import analysis anymore, but dynamic import error still doesn't have
ERR_MODULE_NOT_FOUND
code (or maybe it did when it's fixed but regression).There are some places injecting
ERR_MODULE_NOT_FOUND
, so maybe it works in some cases, but not the basic case above.vitest/packages/vite-node/src/client.ts
Line 296 in 5e6de27
Vite SSR injects
ERR_MODULE_NOT_FOUND
https://github.com/vitest-dev/vite/blob/95020ab49e12d143262859e095025cf02423c1d9/packages/vite/src/node/ssr/fetchModule.ts#L78, so it's working there as well.Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-53av14?file=src%2Frepro.test.js
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: