drawdb-io / drawdb-io/drawdb

Failed to construct 'URL': Invalid URL

Open
#561 15 comments 0 reactions 1 assignee Claimed by @1ilit View on GitHub
Dominant language
JavaScript
Stars
39.5k
Forks
3.2k
Avg merge
10h 46m
Merged PRs (30d)
16

Description

Subject: Import Failure: "Failed to construct 'URL'" Error with Valid Exported JSON​​

​​Description:​​

I am encountering an import error when trying to re-import a JSON file that was previously exported from DrawDB.

​​Error Message:​​

Uncaught (in promise) TypeError: Failed to construct 'URL': Invalid URL
at Object.resolveUrl2 [as resolveUrl] (jsonschema.js?v=852b6613:324:39)
at Validator2.validate (jsonschema.js?v=852b6613:1138:26)
at jsonDiagramIsValid (validateSchema.js:5:26)
at loadJsonData (ImportDiagram.jsx:54:12)
at reader.onload (ImportDiagram.jsx:173:49)
​​Problem Details:​​

1.
The JSON file was originally exported from DrawDB and has not been manually modified.

2.
The file validates as correct JSON syntax through external validators (JSONLint).

3.
​​Crucially, the JSON file contains no explicit URL fields​​ (e.g., no url, host, ip, or linkfields), which makes the error puzzling.

4.
The error occurs during the JSON Schema validation step (jsonschema.js), suggesting an internal validation rule may be incorrectly applied to a non-URL data field.

​​Steps to Reproduce:​​

1.
Export a diagram to JSON from DrawDB.

2.
Attempt to re-import the same JSON file.

3.
The import fails with the above error.

​​Request:​​

Could you please investigate why the JSON Schema validator is attempting to parse a non-URL field as a URL? This appears to be a bug where a validation rule for "format": "uri"is being triggered by standard data.

Thank you for your assistance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.