Skip to content

Fails on running in a symbolic linked directory #9327

@AlttiRi

Description

@AlttiRi

Describe the bug

Vite fails when I try to use it in a sym-linked directory.

Run in CMD:

npm create vite@latest my-vue-app -- --template vue
cd my-vue-app
npm install
cd ..

mklink /d linked-dir my-vue-app
cd linked-dir
npm run dev

Error:

  VITE v3.0.2  ready in 322 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
file:///C:/projects/my-vue-app/node_modules/vite/dist/node/chunks/dep-1513d487.js:36967
            fileHash: getHash(metadata.hash + depsInfo[id].file + JSON.stringify(output.imports)),
                                                                                        ^

TypeError: Cannot read properties of undefined (reading 'imports')
    at runOptimizeDeps (file:///C:/projects/my-vue-app/node_modules/vite/dist/node/chunks/dep-1513d487.js:36967:89)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Reproduction

Auto-generated

System Info

  System:
    OS: Windows 10 10.0.19043
  Binaries:
    Node: 18.2.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.9.0 - C:\Program Files\nodejs\npm.CMD

  Vite: 3.0.2

Used Package Manager

npm

Logs

No response

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