Skip to content

[Bug]: Syntax error with inlined const export #1498

@colinaaa

Description

@colinaaa

Version

System:
    OS: macOS 26.3
    CPU: (12) arm64 Apple M2 Max
    Memory: 467.14 MB / 96.00 GB
    Shell: 4.5.0 - /opt/homebrew/bin/fish
  Browsers:
    Chrome: 145.0.7632.117
    Firefox: 137.0.1
    Safari: 26.3
  npmPackages:
    @rslib/core: ^0.19.6 => 0.19.6

Details

Rslib v0.19.6

info    build started...
error   Build error: 
File: index.js:1:1
  × Chunk minification failed:
  ╰─▶   × JavaScript parse error: Expected ident
          ╭─[11:99]
        9 │
       10 │ async function main() {
       11 │     const { fooVersion } = await import("__RSPACK_ESM_CHUNK_900").then((mod) => ({ fooVersion: mod.(/* inlined export .version */"foo") }));
          ·                                                                                                    ─
       12 │     foo(fooVersion);
       13 │ }
          ╰────

error   build failed in 0.07 s
error   Rspack build failed.

Reproduce link

https://github.com/colinaaa-reproductions/rslib-repro-inline-const

Reproduce Steps

  1. pnpm install
  2. pnpm build

Metadata

Metadata

Assignees

Labels

RspackRspack related issue

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions