Skip to content

Duplication of the same name import for (as A, as A) in build version #578

@oriSomething

Description

@oriSomething

Describe the bug

In build with vite@8.0.0-beta.9 I get a runtime of error of an import statements that tries to import to symbols for the same name

Reproduction

https://github.com/oriSomething/vite-8-duplicated-imports

Steps to reproduce

  1. Clone/create this reproduction
  2. pnpm install
  3. pnpm run build
  4. Check the output files in dist/assets/:
    grep "as import_lodash.*as import_lodash" dist/assets/*.js

System Info

System:
    OS: macOS 26.2
    CPU: (16) arm64 Apple M3 Max
    Memory: 18.37 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.10.0
    npm: 11.6.1
    pnpm: 10.28.1
  npmPackages:
    vite: ^8.0.0-beta.9 => 8.0.0-beta.10

Used Package Manager

pnpm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: upstreamBug in a dependency of Vite

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions