Skip to content

[Bug]: Magic comments parse failed #10183

@Fitz6

Description

@Fitz6

System Info

  System:
    OS: Windows 11 10.0.26100
  Binaries:
    Node: 22.14.0 - ~\AppData\Local\fnm_multishells\5868_1745554632679\node.EXE
    npm: 11.2.0 - ~\AppData\Local\fnm_multishells\5868_1745554632679\npm.CMD
  Browsers:
    Edge: Chromium (135.0.3179.73)
  npmPackages:
    @rspack/core:  1.3.6

Details

function getComponent(name) {
  return () => import(/* webpackInclude: /components[/\\][^/\\]+\.vue$/ */`${name}`);
}
Module parse warning:
  ╰─▶   ⚠ Magic comments parse failed: `webpackInclude` expected a regular expression, but received: /components[/.
          ╭─[8:49]
        6 │         __expose();
        7 │         function getComponent(name) {
        8 │             return ()=>import(/* webpackInclude: /components[/\\][^/\\]+\.vue$/ */`${name}`);
          ·                                                  ─────────────
        9 │         }

Downgrading to version 1.3.5 works fine.

Reproduce link

No response

Reproduce Steps

  1. create a new project
  2. drop the code in, and run it

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions