vega / ts-json-schema-generator

Generate JSON schema from your Typescript sources
MIT License
1.45k stars 195 forks source link

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

Open RohanTalip opened 3 years ago

RohanTalip commented 3 years ago

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?

thw0rted commented 3 years ago

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.)

0x77dev commented 2 years ago

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

ars2062 commented 1 year ago

any updates on this issue?