Skip to content

Fix legacy source-map compatibility issue with browserify#10572

Merged
eanders-ms merged 2 commits intomasterfrom
eanders-ms/cryptomorphic-pylon-array
May 9, 2025
Merged

Fix legacy source-map compatibility issue with browserify#10572
eanders-ms merged 2 commits intomasterfrom
eanders-ms/cryptomorphic-pylon-array

Conversation

@eanders-ms
Copy link
Contributor

After upgrading Node.js from v18 to v22, running gulp began failing with the following error:

TypeError: base64VLQ.decode is not a function
    at SourceMapConsumer._parseMappings (.../source-map-consumer.js:469:23)

This error originates from combine-source-map, a transitive dependency of browserify, which relies on an internal base64VLQ API that was only available in source-map@0.4.x.

During the Node upgrade, node_modules was reinstalled, and combine-source-map picked up a newer source-map@0.5.7, which no longer exposes base64VLQ. This caused the internal call to fail at runtime.

Solution
Added a targeted override to package.json to force combine-source-map to use source-map@0.4.4, which restores compatibility:

"overrides": {
  "combine-source-map": {
    "source-map": "0.4.4"
  }
}

This restores the build without needing to update (or swap out) browserify.

@eanders-ms eanders-ms requested a review from a team May 9, 2025 16:41
@eanders-ms eanders-ms merged commit 5ac0c3d into master May 9, 2025
20 checks passed
@eanders-ms eanders-ms deleted the eanders-ms/cryptomorphic-pylon-array branch May 9, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants