-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
feat(optimizer): show a friendly warning with 404 instead of 504 outdated optimize dep #16080
feat(optimizer): show a friendly warning with 404 instead of 504 outdated optimize dep #16080
Conversation
…ated optimize dep
Run & review this pull request in StackBlitz Codeflow. |
/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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great!
Description
Respond with 404 instead of 504 Outdated optimize dep for files that in dep directory but not handled by Vite.
I set
entryNames
andchunkNames
so 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
).