Build fails on main after picomatch 2.3.2 upgrade

Author: hasanefeuygunCreated Aug 5, 2026Updated Aug 5, 2026

Describe the bug

A clean build of the current main branch fails after running npm ci.

The TypeScript transform skips plain .ts files, causing untransformed TypeScript syntax to reach Babel:

Support for the experimental syntax 'flow' isn't currently enabled

src/patterns.ts:
export type {

Reproduction

bash
git checkout c92ca435c7e1827e0fd55c539080ef1bfd6fe3f0
rm -rf node_modules dist
npm ci
npm run build

Expected behavior

npm run build should successfully generate the package bundles in dist.

Actual behavior

The build fails while Babel is parsing src/patterns.ts.

Bisect result

I used git bisect between the last release and the current main.

  • Good: v5.9.0 (0e15315)
  • Bad: c92ca435c7e1827e0fd55c539080ef1bfd6fe3f0
  • First bad commit:
8d4b56c8fb4f04e0a33be7679a9f8b15e9e2dcfe
build(deps): bump picomatch

The parent of this commit builds successfully in the same environment.

Root cause

Commit 8d4b56c8fb4f04e0a33be7679a9f8b15e9e2dcfe upgrades picomatch from 2.3.1 to 2.3.2.

[email protected] depends on an older version of rollup-plugin-typescript2, whose default TypeScript include pattern uses:

*.ts+(|x)
**/*.ts+(|x)

With [email protected], this pattern no longer matches plain .ts files. As a result, TypeScript files bypass the TypeScript transform and reach Babel untransformed.

[email protected] fixes this compatibility issue by using:

*.ts{,x}
**/*.ts{,x}

Verified solution

Overriding Microbundle's rollup-plugin-typescript2 dependency to version 0.37.0 restores the build:

json
"overrides": {
  "microbundle": {
    ".": "$microbundle",
    "rollup-plugin-typescript2": "0.37.0"
  }
}

The solution was verified from a clean installation:

bash
rm -rf node_modules dist
npm ci
npm run build

The build completed successfully and generated the expected bundles.

Environment

  • Node.js: 20.15.0
  • npm: 10.7.0
  • ts-pattern commit: c92ca435c7e1827e0fd55c539080ef1bfd6fe3f0
  • Package version: 5.9.0
  • Operating system: macOS