fix(cloud-assembly-schema): validation crashes with Invalid URL on Node >= 24.20.0 - #1945
Merged
aws-cdk-automation merged 2 commits intoSep 4, 2026
Conversation
…L on Node >= 24.20.0 jsonschema@1.5.0 builds invalid URLs when resolving local $refs and re-parses them against an opaque base. The Ada 4.0.0 URL parser in Node.js >= 24.20.0 rejects this with "TypeError: Invalid URL", breaking every manifest validation. Apply the upstream fix (tdegrunt/jsonschema#424) via yarn patch, scoped to the jsonschema dependency of @aws-cdk/cloud-assembly-schema.
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
ShadowCat567
approved these changes
Sep 4, 2026
ShadowCat567
left a comment
Contributor
There was a problem hiding this comment.
I do not like this because we have to remember that we did this when jsonschema is fixed but we need this fix sooner than jsonschema is going to roll it out :/
aws-cdk-automation
deleted the
mrgrain/fix/cloud-assembly-schema/jsonschema-invalid-url
branch
September 4, 2026 15:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since GitHub runners started rolling out Node.js 24.20.0 (via
node-version: lts/*), builds have been failing intermittently in@aws-cdk/cloud-assembly-schemawithTypeError: Invalid URLduring schema validation. The failure appears intermittent because it depends on which Node version the runner has cached; it will become permanent as the rollout completes.The root cause is a latent bug in jsonschema@1.5.0 (the latest release). When no
baseoption is passed tovalidate(), it stringifiesundefinedinto its internal base URI, producing ref URIs like/undefined#/definitions/X. It then re-parses these against the opaque basethismessage::/, which is invalid per the WHATWG URL spec. Older URL parsers tolerated this; the Ada 4.0.0 parser shipped in Node.js 24.20.0 correctly rejects it, so every manifest validation throws. Our schemas and refs are standard and not at fault.Since no fixed jsonschema release exists, this applies the upstream fix from tdegrunt/jsonschema#424 via
yarn patch: it splits the#fragment manually instead of round-tripping throughnew URL(). The resolution is scoped to the jsonschema dependency of@aws-cdk/cloud-assembly-schemaand declared in.projenrc.ts, because yarn only reads resolutions from the monorepo root. Note that jsonschema is a bundled dependency, so the patched code ships in the published package. The patch should be removed once upstream releases a fix.Verified by running the full
@aws-cdk/cloud-assembly-schematest suite (38 passed) and by exercising manifest loading with a simulated strict URL parser that throws like Node 24.20.0 does.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license