Skip to content

unexpected error: Invalid regular expression flags #11546

@jkowalleck

Description

@jkowalleck

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

11.0.8

Which area(s) of pnpm are affected? (leave empty if unsure)

Link to the code that reproduces this issue or a replay of the bug

https://github.com/CycloneDX/cyclonedx-node-module

Reproduction steps

on a node18+ with pnpm11.0.8

  1. clone https://github.com/CycloneDX/cyclonedx-node-module
  2. cd into the clone
  3. run pnpm install --no-lockfile --verbose
    this will not success and error as described below.

Describe the Bug

run nightly: https://github.com/CycloneDX/cyclonedx-node-module/blob/bc33c84b295fd9ba07b733e71179b97ba518a01d/.github/workflows/nodejs.yml#L152-L156 in my test-env for https://github.com/CycloneDX/cyclonedx-node-module

pnpm install --no-lockfile --verbose

this worked with pnpm 10.33.4 - see logs https://github.com/CycloneDX/cyclonedx-node-module/actions/runs/25467954147/job/74725322164#step:5:1

but failed with pnpm 11.0.8 - see logs: https://github.com/CycloneDX/cyclonedx-node-module/actions/runs/25528781889/job/74930276514#step:5:8

file:///Users/runner/setup-pnpm/node_modules/.pnpm/pnpm@11.0.8/node_modules/pnpm/dist/pnpm.mjs:265042
    zeroWidthClusterRegex = /^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Mark}|\p{Surrogate})+$/v;
                            ^

SyntaxError: Invalid regular expression flags
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:152:18)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:299:14)

as shown in this text matrix

this behavior occurred on ubuntu and windows and macos with node18

Expected Behavior

pnpm install --no-lockfile --verbose runs just fine.

Which Node.js version are you using?

18.20.8

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions