Skip to content

fix: fallback for URL.canParse missing in some environments (#92)#93

Open
Shaharyar07 wants to merge 1 commit into
braintree:mainfrom
Shaharyar07:fix/url-canparse-fallback
Open

fix: fallback for URL.canParse missing in some environments (#92)#93
Shaharyar07 wants to merge 1 commit into
braintree:mainfrom
Shaharyar07:fix/url-canparse-fallback

Conversation

@Shaharyar07

@Shaharyar07 Shaharyar07 commented Jan 24, 2026

Copy link
Copy Markdown

Summary of changes

This PR adds a safe fallback when URL.canParse is not available in the runtime environment.
Some environments (older Node.js / browsers) do not implement URL.canParse, which caused sanitizeUrl to throw a TypeError.

Checklist

  • Added a changelog entry
  • Relevant test coverage
  • Tested and confirmed flows affected by this change are functioning as expected

Authors

@Shaharyar07

List GitHub usernames for everyone who contributed to this pull request.

Reviewers

@braintree/team-sdk-js

@Shaharyar07 Shaharyar07 requested a review from a team as a code owner January 24, 2026 14:56
@stephan281094

Copy link
Copy Markdown

Running into the same problem, can this be merged?

@rpearce

rpearce commented Apr 24, 2026

Copy link
Copy Markdown

Chiming in: this issue unfortunately causes issues for apps that haven't polyfilled this web feature, as well as for people who haven't upgrade Browserless PDF generation Chrome versions lately.

Thank you to those who made the PR

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.

3 participants