Skip to content

deps.optimizer appears broken in 0.34.3 #4020

@thebanjomatic

Description

@thebanjomatic

Describe the bug

This is new behavior for me starting in 0.34.3. 0.34.2 works correctly for me.

If I pass dependencies to deps.optimizer.web.includes, it appears to usually work the first time, but then it fails to save the dependencies with the following error:

[vite] error while updating dependencies:
Error: ENOENT: no such file or directory, rename 'C:\source\test-project\node_modules\.vitest\deps_temp_c61dd53a' -> 'C:\source\test-project\node_modules\.vitest\deps'

And then on subsequent runs, there is a long delay before timing out and producing the following error:

file:///C:/source/test-project/node_modules/vite-node/dist/server.mjs:310
        throw new Error(`ViteNodeServer: ${id} not found. This is a bug, please report it.`);
        ^

Error: ViteNodeServer: C:/source/test-project/node_modules/.vitest/deps/vue.js not found. This is a bug, please report it.
    at Timeout._onTimeout (file:///C:/source/test-project/node_modules/vite-node/dist/server.mjs:310:15)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)

Reproduction

Doesn't actually appear to reproduce in stackblitz, but does reproduce for me on windows:
https://stackblitz.com/edit/vitest-dev-vitest-ycqdpe?file=vite.config.ts

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
    Memory: 13.28 GB / 31.64 GB
  Binaries:
    Node: 20.5.1 - ~\AppData\Local\Volta\tools\image\node\20.5.1\node.EXE
    Yarn: 3.6.1 - ~\AppData\Local\Volta\tools\image\yarn\1.22.19\bin\yarn.CMD
    npm: 9.8.0 - ~\AppData\Local\Volta\tools\image\node\20.5.1\npm.CMD
    pnpm: 8.6.12 - ~\AppData\Local\Volta\tools\image\pnpm\8.6.12\bin\pnpm.CMD
  Browsers:
    Edge: Spartan (44.22621.2134.0), Chromium (115.0.1901.200)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @vitejs/plugin-vue2: ^2.2.0 => 2.2.0
    vite: ^4.0.4 => 4.4.4
    vitest: 0.34.3 => 0.34.3

Used Package Manager

yarn

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions