Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

ILLEGAL_REASSIGNMENT Error when using defineModel() with reactive() #432

@wouterkroes

Description

@wouterkroes

Describe the bug

I am doing

In this Vue.js example I bind a reactive() to the v-model of a child component (MyComponent.vue). In MyComponent I use defineModel() to implement a two-way binding.

What I expect

When I build the Vue application I would expect no build errors.

What actually happening is

When I build the Vue application vite-rolldown throws the following error:

rolldown-vite v7.1.13 building for production...
✓ 9 modules transformed.
✗ Build failed in 621ms
error during build:
Build failed with 1 error:

[ILLEGAL_REASSIGNMENT] Error: Unexpected re-assignment of const variable `name`
    ╭─[ src/App.vue:16:66 ]
    │
 11 │ const name = reactive({ first: 'john', last: 'doe' });
    │       ──┬─  
    │         ╰─── `name` is declared here as const
    │ 
 16 │     "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((name) = $event))
    │                                                                  ──┬─  
    │                                                                    ╰─── `name` is re-assigned here
────╯

    at normalizeErrors (file:///home/projects/stackblitz-starters-vrpndhpf/node_modules/rolldown/dist/shared/src-BH2eQDD9.mjs:2175:18)
    at handleOutputErrors (file:///home/projects/stackblitz-starters-vrpndhpf/node_modules/rolldown/dist/shared/src-BH2eQDD9.mjs:2910:34)
    at transformToRollupOutput (file:///home/projects/stackblitz-starters-vrpndhpf/node_modules/rolldown/dist/shared/src-BH2eQDD9.mjs:2904:2)
    at RolldownBuild.write (file:///home/projects/stackblitz-starters-vrpndhpf/node_modules/rolldown/dist/shared/src-BH2eQDD9.mjs:4122:10)
    at async buildEnvironment (file:///home/projects/stackblitz-starters-vrpndhpf/node_modules/vite/dist/node/chunks/dep-CqBYPNx_.js:33282:64)
    at async Object.build (file:///home/projects/stackblitz-starters-vrpndhpf/node_modules/vite/dist/node/chunks/dep-CqBYPNx_.js:33686:19)
    at async Object.buildApp (file:///home/projects/stackblitz-starters-vrpndhpf/node_modules/vite/dist/node/chunks/dep-CqBYPNx_.js:33683:153)
    at async CAC.eval (file:///home/projects/stackblitz-starters-vrpndhpf/node_modules/vite/dist/node/cli.js:656:3)

Extra information

The same Vue app works as expected in the Vue SFC Playground AND on a local npm create vue@latest WITHOUT experimental vite-rolldown.

Reproduction

https://stackblitz.com/edit/stackblitz-starters-vrpndhpf?file=vite.config.js

Steps to reproduce

Run npm run build in the Stackblitz reproduction example.

System Info

The Stackblitz reproduction example was created by running `npm create vue@latest` with experimental vite-rolldown

---


  System:
    OS: Linux 5.0 undefined
    CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /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:
    @vitejs/plugin-vue: ^6.0.1 => 6.0.1 
    rolldown-vite:  7.1.13

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions