feat(optimizer): show a friendly warning with 404 instead of 504 outdated optimize dep#16080
Conversation
…ated optimize dep
|
|
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI on
✅ analogjs, astro, histoire, ladle, laravel, marko, nuxt, previewjs, qwik, rakkas, sveltekit, unocss, vike, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-pages, vite-plugin-react-swc, vite-plugin-vue, vite-setup-catalogue, vitepress, vitest |
|
plugin-svelte fail is expected. The snapshot needs to be updated because the path of the optimized files are changed. |
|
I'm not quite sure about this change since the optimized dep directory now looks like During esbuild prebundling, we should have a metafile of all output files. Could we match against that instead? |
To do that, we'll have to save the previous We can make the prefix ( |
I'm not sure I understand. Isn't it already handled here? If I change the check to if (metadata.depInfoList.some((dep) => dep.file === file)){
// Outdated non-entry points (CHUNK), loaded after a rerun
throwOutdatedRequest(id)
}
throwFileNotFoundInOptimizedDep(id)It seems to work (test passing). |
|
Ah, that's right. I'll update to do it like that. |
Description
Respond with 404 instead of 504 Outdated optimize dep for files that in dep directory but not handled by Vite.
I set
entryNamesandchunkNamesso that the files Vite expects all have the same prefix__vite-. If a file that doesn't have that prefix is imported, it means it's something that we don't support. In that case, Vite now responds with 404 instead of 504, and shows a warning that a dependency might be incompatible.close #13506
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).