Skip to content

Failed to resolve import error since vite 7.0.5 #20479

Closed

Description

@romansp

Describe the bug

Sine vite 7.0.5 I'm experiencing resolve import errors for files that worked just fine in 7.0.4. Most likely caused by changes in #20382

[plugin:vite:import-analysis] Failed to resolve import "/home/projects/vitejs-vite-7aterhot/src" from "src/dotnet.native.8.0.11.l2ick3ktbp.js". Does the file exist?

Adding /* @vite-ignore */ is not feasible solution because imported file is actually generated and comes from a third-party. So we don't have control over it. It's actually a wasm build of dotnet application with dotnet.js scripts which bootstrap the app.

Error only happens while running dev server. Production builds still work just fine.

Current workaround is to downgrade back to 7.0.4.

Reproduction

https://stackblitz.com/edit/vitejs-vite-7aterhot?file=src%2Fdotnet.native.8.0.11.l2ick3ktbp.js,src%2Fmain.js&terminal=dev

Steps to reproduce

No response

System Info

System:
    OS: macOS 15.5
    CPU: (10) arm64 Apple M1 Pro
    Memory: 178.92 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.17.1 - ~/.nvm/versions/node/v22.17.1/bin/node
    Yarn: 4.9.2 - ~/.nvm/versions/node/v22.17.1/bin/yarn
    npm: 10.9.2 - ~/.nvm/versions/node/v22.17.1/bin/npm
    bun: 1.2.19 - ~/.bun/bin/bun
  Browsers:
    Chrome: 138.0.7204.169
    Safari: 18.5
  npmPackages:
    @vitejs/plugin-vue: ^6.0.0 => 6.0.0 
    @vitejs/plugin-vue-jsx: ^5.0.1 => 5.0.1 
    vite: ^7.0.6 => 7.0.6

Used Package Manager

npm

Logs

No response

Validations

Activity

  1. added theissue type on Jul 25, 2025
  2. changed the title [-]Failed to resolve import error in vite 7.0.5[/-] [+]Failed to resolve import error since vite 7.0.5[/+] on Jul 30, 2025
  3. added
    p2-edge-case
    regression
    on Jul 30, 2025
  4. locked and limited conversation to collaborators on Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-edge-caseregression

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions