-
Notifications
You must be signed in to change notification settings - Fork 6k
[Vite][Dev Server] Unable to change packages' version, after deno install #32054
Description
Version: Deno 2.6.8
Area
Vite's Dev server
Description
Unable to change packages' version, after first deno install. No matter upgrade, or downgrade.
It only affects vite dev server, when I try to build the dist files (vite build), it does match the target version.
Mainly affects frontend packages, like vue.
Reproduce steps
It is possible to reproduce using the recommended command deno run -A npm:create-vite, but I slightly modified the sample project, so that it prints the vue version. It would be easier to see the issue.
I used Vue for example, it should happen on any frontend packages.
-
Clone my repo
git clone https://github.com/louislam/deno-vite-issue-reproduce.git cd deno-vite-issue-reproduce deno install deno task dev -
Go to http://localhost:5173
-
You should see Vue 3.5.16
-
Ctrl + C to shutdown the dev server
-
Open
package.json, editvueversion to3.5.17 -
deno install -
deno task dev -
Go to http://localhost:5173 again
-
You should see Vue 3.5.16 again, which is unexpected.
Node.js for comparison
# Delete node_modules which is created by Deno
rm -rf ./node_modules
git clone https://github.com/louislam/deno-vite-issue-reproduce.git
cd deno-vite-issue-reproduce
npm install
npm run dev
# You should see Vue 3.5.16
# Now edit to 3.5.17
npm install
npm run dev
# You should see Vue 3.5.17Workaround
I can overcome the issue by deleting node_modules and run deno install again.