Skip to content

[Vite][Dev Server] Unable to change packages' version, after deno install #32054

@louislam

Description

@louislam

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.

  1. Clone my repo

    git clone https://github.com/louislam/deno-vite-issue-reproduce.git
    cd deno-vite-issue-reproduce
    deno install
    deno task dev
  2. Go to http://localhost:5173

  3. You should see Vue 3.5.16

  4. Ctrl + C to shutdown the dev server

  5. Open package.json, edit vue version to 3.5.17

  6. deno install

  7. deno task dev

  8. Go to http://localhost:5173 again

  9. 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.17

Workaround

I can overcome the issue by deleting node_modules and run deno install again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions