Skip to content

Regression in 3.5.23: fails to parse ! in typescript #14060

@cyberalien

Description

@cyberalien

Vue version

3.5.23

Link to minimal reproduction

https://github.com/cyberalien/vue-3-5-23-bug

Steps to reproduce

Run npm run build

What is expected?

Expected to to compile

What is actually happening?

error during build:
[vite:esbuild] Transform failed with 1 error:
/bug-test/src/App.vue?vue&type=script&setup=true&lang.ts:22:2: ERROR: Expected "]" but found "}"
file: /bug-test/src/App.vue?vue&type=script&setup=true&lang.ts:22:2

Expected "]" but found "}"
20 |    return (_openBlock(), _createElementBlock("p", {
21 |      "data-foo": data[key.value
22 |    }, "Test", 8, _hoisted_1))
   |    ^
23 |  }
24 |  }

    at failureErrorWithLog (/bug-test/node_modules/esbuild/lib/main.js:1467:15)
    at /bug-test/node_modules/esbuild/lib/main.js:736:50
    at responseCallbacks.<computed> (/bug-test/node_modules/esbuild/lib/main.js:603:9)
    at handleIncomingPacket (/bug-test/node_modules/esbuild/lib/main.js:658:12)
    at Socket.readFromStdout (/bug-test/node_modules/esbuild/lib/main.js:581:7)
    at Socket.emit (node:events:519:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)
ERROR: "build-only" exited with 1.

System Info

System:
    OS: macOS 26.1
    CPU: (10) arm64 Apple M5
    Memory: 640.25 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.21.0 - /Users/slava/.nvm/versions/node/v22.21.0/bin/node
    npm: 10.9.4 - /Users/slava/.nvm/versions/node/v22.21.0/bin/npm
    pnpm: 9.15.9 - /Users/slava/.nvm/versions/node/v22.21.0/bin/pnpm
    bun: 1.3.1 - /Users/slava/.bun/bin/bun
  Browsers:
    Chrome: 142.0.7444.60
    Firefox: 144.0.2
    Firefox Nightly: 146.0a1
    Safari: 26.1
    Safari Technology Preview: 26.0
  npmPackages:
    vue: ^3.5.22 => 3.5.23

Any additional comments?

Bug is triggered by ! on line 12 of App.vue

That's valid TypeScript syntax, even though it doesn't make sense in this code because this is reduced test case to show bug.

Worked fine in 3.5.22

Metadata

Metadata

Assignees

No one assigned

    Labels

    ❗ p4-importantPriority 4: this fixes bugs that violate documented behavior, or significantly improves perf.regression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions