You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom commands fail to load on Node.js 24.20.0 with "Invalid URL" #169
Just ran into this exact same problem while debugging my commands inside a Docker environment on a server, so seeing this issue opened was very timely. I tested and reproduced the exact same failure across Amazon Linux and Windows specifically after updating to Node.js v24.20.0 (everything was running fine on v24.11.1 / v24.19.0).
Spent some time tracing through the execution inside validateCommandMetaData and jsonschema to find why Ace was throwing Invalid URL on completely valid commands. Here's the step-by-step diagnostic:
Root Cause Breakdown
Missing base / schema ID:
Ace defines its command validation schema using Draft-07 conventions without an explicit id (Draft-04) or $id (Draft-07) at the root level, and no options.base is provided when calling new Validator().validate(command, schema).
Pointer resolution in jsonschema:
Because Ace's schema starts with $ref: "#/definitions/CommandMetaData", jsonschema delegates to Validator.prototype.resolve() (node_modules/jsonschema/lib/validator.js:263).
When ctx.resolve() computes the relative reference against the empty base, it concatenates schema.id (undefined) with the fragment pointer, yielding an absolute path with a leading slash: '/undefined#/definitions/CommandMetaData'.
Node 24.20.0 strict URL parser: jsonschema then evaluates:
letparsed=newURL(switchSchema,'thismessage::/');
In Node <= 24.19.0, the parser tolerantly allowed absolute paths (starting with /) against non-hierarchical/opaque dummy schemes like thismessage::/.
Starting in Node 24.20.0, the ada URL parser was updated to version 4.0.0 (7b1898a341) which strictly follows the WHATWG URL Standard. It now correctly rejects absolute paths on schemes without a host, immediately throwing TypeError [ERR_INVALID_URL]: Invalid URL.
Minimal Reproduction in Node 24.20.0
# Throws TypeError [ERR_INVALID_URL] in Node 24.20.0:
node -e "new URL('/undefined#/definitions/CommandMetaData', 'thismessage::/')"# Passes if the base URI is hierarchical:
node -e "console.log(new URL('/undefined#/definitions/CommandMetaData', 'http://localhost/').href)"
Potential Fixes in Ace
Provide an explicit schema $id / base when invoking new Validator().validate(...), or validate definitions.CommandMetaData directly to avoid the root-level $ref URL resolution.
Alternatively, migrate the metadata validation to VineJS or a modern schema validator to remove the legacy jsonschema dependency entirely.
Temporary workaround for anyone blocked: patch 'thismessage::/' to 'http://localhost/' in node_modules/jsonschema/lib/validator.js via patch-package, or pin your environment to node:24.19 / Node <= 24.19.0.
Activity
mateocerri commentedon Aug 28, 2026
Just ran into this exact same problem while debugging my commands inside a Docker environment on a server, so seeing this issue opened was very timely. I tested and reproduced the exact same failure across Amazon Linux and Windows specifically after updating to Node.js v24.20.0 (everything was running fine on
v24.11.1/v24.19.0).Spent some time tracing through the execution inside
validateCommandMetaDataandjsonschemato find why Ace was throwingInvalid URLon completely valid commands. Here's the step-by-step diagnostic:Root Cause Breakdown
Missing base / schema ID:
Ace defines its command validation schema using Draft-07 conventions without an explicit
id(Draft-04) or$id(Draft-07) at the root level, and nooptions.baseis provided when callingnew Validator().validate(command, schema).Pointer resolution in
jsonschema:Because Ace's schema starts with
$ref: "#/definitions/CommandMetaData",jsonschemadelegates toValidator.prototype.resolve()(node_modules/jsonschema/lib/validator.js:263).When
ctx.resolve()computes the relative reference against the empty base, it concatenatesschema.id(undefined) with the fragment pointer, yielding an absolute path with a leading slash:'/undefined#/definitions/CommandMetaData'.Node 24.20.0 strict URL parser:
jsonschemathen evaluates:In Node
<= 24.19.0, the parser tolerantly allowed absolute paths (starting with/) against non-hierarchical/opaque dummy schemes likethismessage::/.Starting in Node
24.20.0, theadaURL parser was updated to version 4.0.0 (7b1898a341) which strictly follows the WHATWG URL Standard. It now correctly rejects absolute paths on schemes without a host, immediately throwingTypeError [ERR_INVALID_URL]: Invalid URL.Minimal Reproduction in Node 24.20.0
Potential Fixes in Ace
$id/ base when invokingnew Validator().validate(...), or validatedefinitions.CommandMetaDatadirectly to avoid the root-level$refURL resolution.jsonschemadependency entirely.Temporary workaround for anyone blocked: patch
'thismessage::/'to'http://localhost/'innode_modules/jsonschema/lib/validator.jsviapatch-package, or pin your environment tonode:24.19/ Node<= 24.19.0.Fix the actual regression: bump @adonisjs/ace, drop the Node pin
Fix apps/api test hang: bump @adonisjs/ace to 14.1.1 (Node 24.20 load…
Fix CI: bump @adonisjs/ace to 14.1.1, pin Node to 24.20.0 everywhere
Fix clipped ActionMenu/HelpTooltip popovers; kick off UI/UX overhaul …