Describe the bug
Reproduction instructions
- Download https://stackblitz.com/edit/vitejs-vite-9ibgrz (just a base Vite project with a
my-test-project directory that has a boilerplate package.json to use)
- StackBlitz uses
turbo under the hood for installing packages and I can't figure out how to do the local linking which is essential the reproduction. yarn link -> ERR!: Unknown command 'link'
yarn
- Fake a
yarn add my-test-dependency by running cp -R my-test-dependency node_modules/my-test-dependency
yarn dev (this will create pre-bundled dependencies for my-test-dependency and populate node_modules/.vite)
- Notice
my-test-dependency asdf log in the devtools console
- Get
my-test-dependency ready for linking: cd my-test-dependency && yarn link && cd ..
- Locally link it in your project:
yarn link my-test-dependency
yarn dev
- Notice
my-test-dependency asdf log in the devtools console
- Edit
./my-test-dependency/index.js to a different console.log('other message') just to show that Vite is pulling from the wrong spot
- Notice how the log message never changes to what you set
This use-case happens when you're doing some development on a project, find a problem in a sub-dependency, then link it locally to dive deeper.
Expected result
Vite would see that the dependency/package is now linked locally and will bust it's own pre-bundle cache.
Workaround
- Clear your pre-bundled dependency build cache
rm -rf ./node_modules/.vite
- Notice how Vite is correctly bundling your locally linked package now and has the updated message
Dev notes
Relevant docs:
Reproduction
StackBlitz uses turbo under the hood for installing packages and I can't figure out how to do the local linking which is essential the reproduction. yarn link -> ERR!: Unknown command 'link'. See the reproduction steps above instead ^

System Info
npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers
npx: installed 1 in 2.131s
System:
OS: Windows 10 10.0.19044
Binaries:
Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.17 - C:\Program Files\nodejs\yarn.CMD
npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 97.0.4692.99
Used Package Manager
yarn
Logs
No response
Validations
Describe the bug
Reproduction instructions
my-test-projectdirectory that has a boilerplatepackage.jsonto use)turbounder the hood for installing packages and I can't figure out how to do the local linking which is essential the reproduction.yarn link->ERR!: Unknown command 'link'yarnyarn add my-test-dependencyby runningcp -R my-test-dependency node_modules/my-test-dependencyyarn dev(this will create pre-bundled dependencies formy-test-dependencyand populatenode_modules/.vite)my-test-dependency asdflog in the devtools consolemy-test-dependencyready for linking:cd my-test-dependency && yarn link && cd ..yarn link my-test-dependencyyarn devmy-test-dependency asdflog in the devtools console./my-test-dependency/index.jsto a differentconsole.log('other message')just to show that Vite is pulling from the wrong spotThis use-case happens when you're doing some development on a project, find a problem in a sub-dependency, then link it locally to dive deeper.
Expected result
Vite would see that the dependency/package is now linked locally and will bust it's own pre-bundle cache.
Workaround
rm -rf ./node_modules/.viteDev notes
Relevant docs:
Reproduction
StackBlitz uses
turbounder the hood for installing packages and I can't figure out how to do the local linking which is essential the reproduction.yarn link->ERR!: Unknown command 'link'. See the reproduction steps above instead ^System Info
vite@2.7.13Used Package Manager
yarn
Logs
No response
Validations