Skip to content

[Bug]: incorrect execution order when moduleSideEffects: 'no-treeshake' module exists #8863

@sapphi-red

Description

@sapphi-red

Reproduction link or steps

  1. Open https://stackblitz.com/edit/rolldown-rolldown-starter-stackblitz-k5yeeoah?file=package.json
  2. pnpm i and pnpm build runs automatically
  3. Run pnpm exec:original to see the behavior of the input file. It should output undefined.
  4. Run pnpm exec:built to see the behavior of the bundled file.
  5. Run pnpm build:up to bundle with Rollup
  6. Run pnpm exec:built to see the behavior of the bundled file by Rollup.

What is expected?

The bundled file outputs undefined.

What is actually happening?

The following error happens when running the bundled file:

TypeError: Cannot read properties of undefined (reading 'Designer')

System Info

StackBlitz

  System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 22.22.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @rolldown/browser:  1.0.0-rc.10

Any additional comments?

Originally reported at vitejs/vite#21975

Metadata

Metadata

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions