Skip to content

TypeError: dependentEntriesByModule.get is not a function in large builds (Vite 7.3.x) #21970

@blackundo

Description

@blackundo

Describe the bug

Environment

  • Vite: 7.3.1
  • Rollup: 4.59.0
  • Nuxt: 4.2.2
  • Node: 20.x

Describe the bug

Build fails with TypeError: dependentEntriesByModule.get is not a function or its return value is not iterable when project has
2400+ modules.

Steps to reproduce

  1. Large Nuxt 4.2.x project (2400+ modules)
  2. Run nuxt build
  3. After "✓ N modules transformed" → build fails with this TypeError

Workaround

// nuxt.config.ts
vite: {
  build: {
    rollupOptions: {
      treeshake: false  // disables tree shaking — increases bundle size
    }
  }
}

Expected behavior

Build completes successfully with tree shaking enabled.

Notes

- Error only occurs with 2400+ modules (small projects pass)
- Introduced in Vite 7.3.x (7.2.x was fine)
- dependentEntriesByModule appears to be an internal Rollup/CommonJS plugin API

### Reproduction

https://github.com/blackundo/m.ushort-frontend

### Steps to reproduce

_No response_

### System Info

```shell
System:
  OS: macOS 26.0.1
  CPU: (8) arm64 Apple M1
  Memory: 100.64 MB / 8.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 25.2.1 - /opt/homebrew/bin/node
  Yarn: 1.22.21 - /opt/homebrew/bin/yarn
  npm: 11.6.2 - /opt/homebrew/bin/npm
  pnpm: 10.7.1 - /Users/blackundo/.npm-packages/bin/pnpm
Browsers:
  Safari: 26.0.1

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions