Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regression] Parsing web types schema throws a JS error starting from 15.0.0 #649

Open
vursen opened this issue Dec 25, 2024 · 0 comments
Open

Comments

@vursen
Copy link

vursen commented Dec 25, 2024

Starting from version 15.0.0, parsing the web types schema with the following script:

import { compile } from 'json-schema-to-typescript';

const schema = await fetch('https://json.schemastore.org/web-types').then((response) => response.json());
const ts = await compile(schema, 'WebTypes');

throws the error:

/Users/vursen/dev/vaadin/react-components/node_modules/json-schema-to-typescript/dist/src/parser.js:22
            ast.params.push(parseAsTypeWithCache(schema, type, options, keyName, processed, usedNames));
                       ^

TypeError: Cannot read properties of undefined (reading 'push')
    at /Users/vursen/dev/vaadin/react-components/node_modules/json-schema-to-typescript/dist/src/parser.js:22:24
    at Set.forEach (<anonymous>)
    at parse (/Users/vursen/dev/vaadin/react-components/node_modules/json-schema-to-typescript/dist/src/parser.js:21:15)
    at /Users/vursen/dev/vaadin/react-components/node_modules/json-schema-to-typescript/dist/src/parser.js:305:14
    at /Users/vursen/dev/vaadin/react-components/node_modules/lodash/lodash.js:3585:27
    at /Users/vursen/dev/vaadin/react-components/node_modules/lodash/lodash.js:4967:15
    at baseForOwn (/Users/vursen/dev/vaadin/react-components/node_modules/lodash/lodash.js:3032:24)
    at /Users/vursen/dev/vaadin/react-components/node_modules/lodash/lodash.js:4936:18
    at baseMap (/Users/vursen/dev/vaadin/react-components/node_modules/lodash/lodash.js:3584:7)
    at map (/Users/vursen/dev/vaadin/react-components/node_modules/lodash/lodash.js:9622:14)
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

No branches or pull requests

1 participant