Skip to content

fix(runtime): support Node 18 regex fallback - #696

Open
John-David Dalton (jdalton) wants to merge 1 commit into
jdalton/socket-sdk-purl-query-options-v2from
fix/node18-regex-fallback
Open

John-David Dalton (jdalton) wants to merge 1 commit into
jdalton/socket-sdk-purl-query-options-v2from
fix/node18-regex-fallback

Conversation

@jdalton

Copy link
Copy Markdown
Collaborator

Create the Unicode-set regexes at runtime so Node 18 can reach the existing fallback instead of failing to parse the SDK bundle.

@cursor

cursor Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Localized vendor patch to string-width regex initialization; behavior on supported Node versions is unchanged and fallback logic was already present.

Overview
Adds a pnpm patch on @socketsecurity/lib@7.1.0 so string-width helpers in dist/strings/width.js build Unicode-set regexes with new RegExp(..., 'v') instead of /.../v literals.

On Node 18, regex literals using the v flag fail at parse/load time, so the package's existing try/catch fallback to /u regexes never ran. Runtime construction defers the unsupported flag to execution, letting Node 18 load the bundle and use the fallback.

The patch is registered in pnpm-workspace.yaml patchedDependencies; pnpm-lock.yaml updates every @socketsecurity/lib resolution to include the new patch hash.

Reviewed by Cursor Bugbot for commit 39d8e73. Configure here.

@jdalton
John-David Dalton (jdalton) force-pushed the fix/node18-regex-fallback branch 3 times, most recently from 8912a0b to 84e3c40 Compare November 21, 2026 04:08
@jdalton
John-David Dalton (jdalton) changed the base branch from main to jdalton/socket-sdk-purl-query-options-v2 November 21, 2026 04:08

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants