-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Description
Describe the bug
I manually adjusted the package versions in package.json
file and then run $ yarn
to install the latest packages with bug fix.
Then I started $ yarn dev
, however I am still using an older package with bug. The optimize dependency is not working, and this caused some confusion in our team.
Reproduction
https://stackblitz.com/edit/vitejs-vite-swnnga3g?file=index.html&terminal=dev
Steps to reproduce
Install the dependency, then open and close vite dev server.
Next upgrade or downgrade the react version 18->19 in package.json
Install the dependency, then open and close vite dev server again.
Check the folder content in node_modules/.vite/deps and it did not change despite the version is updated.
Additional info: we configured the installStatePath in yarn to be a non-default one so the dependency info can be automatically collected by our logging system which monitors dependency confusion attacks.
Work around: use --force flag
Regression seems get introduced in #18560
System Info
System:
OS: macOS 14.5
CPU: (8) arm64 Apple M2
Memory: 82.11 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - /usr/local/bin/node
Yarn: 1.22.21 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.12.0 - /usr/local/bin/pnpm
Browsers:
Safari: 17.5
Used Package Manager
yarn
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.