Vite fails to build when source maps link to non existing file with error: "ENOENT: no such file or directory" #3868
Labels
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
Some packages provide source maps in node_modules, when they do if the source map link to a .ts file and the .ts file is not in the folder, source map resolution will fail with an error like this:
ENOENT: no such file or directory, open 'C:\workspace\m7d\svelte-context-enhanced\website\node_modules\@material\ripple\index.ts'
The worst thing is that the error won't have any stacktrace and because of that it is really hard to debug.
This problem will prevent the project to build, specifically i'm having this problem from https://github.com/sveltejs/kit; the built page fail to load with this error:
I'm working to a solution to this problem and this is what i've come so far: https://github.com/raythurnevoid/vite/commit/f609451ccaaf74a28171a8d567e5aef11f962342
Reproduction
This error can be reproduced in this repository i'm currently working on: https://github.com/raythurnevoid/svelte-context-enhanced/tree/new_website
System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager: npm
Logs
Show details (sorry for sass deprecation warnings)
The text was updated successfully, but these errors were encountered: