Vite server crashes when starting dev server after optimizing new dependencies [ERR_OUTDATED_OPTIMIZED_DEP] #7369
Labels
p4-important
Violate documented behavior or significantly improves performance (priority)
Describe the bug
As a followup to a discussion with @patak-dev on Discord, I'd like to report a bug with the Vite 2.9.0-beta.2 release concerning the optimization of newly discovered dependencies.
While Vite 2.9.0-beta.2 does resolve another issue by only optimizing dependencies once at server start, there is an additional bug where the server crashes right after starting (with dev command) when there is a newly discovered dependency, such as through a newly added import statement in one of the source files. Upon subsequent server starts, it will no longer yield the error and cold boot correctly.
In this example, the following error appears when a new
element plus
dependency is discovered. Note that this isn't specific toelement plus
, as it also happens with packages such aslodash-es
and its modules.It is easily reproduced by cloning the Element Plus Vite starter template, changing the Vite version to 2.9.0-beta.2, running
pnpm upgrade
, starting the dev server and navigating to the app in the browser.Reproduction
In issue description
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: