ts-json-schema-generator icon indicating copy to clipboard operation
ts-json-schema-generator copied to clipboard

Error: Unknown node "Application" (ts.SyntaxKind = 190)

Open RohanTalip opened this issue 4 years ago • 3 comments

Hi,

I'm trying to move from typescript-json-schema to ts-json-schema-generator, but I'm seeing this error:

Error: Unknown node "Application" (ts.SyntaxKind = 190) at /Users/rohantalip/repo/node_modules/@types/express-serve-static-core/index.d.ts(477,9)

I have "@types/express": "4.16.1" specified in my package.json file.

npm list @types/express-serve-static-core shows that it is resolving with version 4.17.2.

This is probably the version of the file in the DefinitelyTyped repository: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4331db7e1c7da5e87bf2faa41e2c81859e125ab8/types/express-serve-static-core/index.d.ts#L477

Any ideas?

RohanTalip avatar Nov 08 '21 05:11 RohanTalip

Have you tried --no-type-check? I was initially unable to get the generator CLI to run because it was trying to parse complex types from a library I happened to have installed, but had nothing to do with the interface I actually wanted to make a schema for. By running the CLI with npx ts-json-schema-generator -p MyService.ts -t "MyInterface" -f tsconfig.json --no-type-check I was able to get past that error. (I'm assuming that whatever object you're trying serialize / parse shouldn't have a property that is an Express Application, because that wouldn't make any sense.)

thw0rted avatar Nov 12 '21 16:11 thw0rted

Same issue here ts-json-schema-generator -p './dist/stack/interfaces.d.ts' -t 'StackOptions' -f ./tsconfig.json --no-type-check

gives:

Error: Unknown node "SignedMessage" (ts.SyntaxKind = 157) at /Users/0x77/Projects/dstack/node_modules/@libp2p/interface-pubsub/dist/src/index.d.ts(41,30)

--no-type-check has no effect

0x77dev avatar Aug 31 '22 15:08 0x77dev

any updates on this issue?

ars2062 avatar Feb 19 '23 05:02 ars2062