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
I'm getting this error from running TJS.generateSchema():
/Users/me/my-project/node_modules/@types/graphql/execution/execute.d.ts (55,4): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/graphql/graphql.d.ts (37,4): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/graphql/type/definition.d.ts (244,35): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/graphql/type/definition.d.ts (250,16): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/isomorphic-fetch/index.d.ts (8,30): Cannot find name 'fetch'.
/Users/me/my-project/node_modules/@types/pg/index.d.ts (71,16): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/pg/index.d.ts (74,33): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/pg/index.d.ts (77,53): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/pg/index.d.ts (78,46): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/pg/index.d.ts (96,53): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/pg/index.d.ts (97,46): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/request-promise-native/index.d.ts (11,59): Cannot find name 'Promise'.
/Users/me/my-project/node_modules/@types/request-promise-native/index.d.ts (12,24): Cannot find name 'Promise'.
My code:
import {resolve} from "path";
import * as TJS from "typescript-json-schema";
// optionally pass argument to schema generator
const settings: TJS.PartialArgs = {
required: true
};
const program = TJS.getProgramFromFiles([resolve("./src/models/Json.ts")]);
// We can either get the schema for one file and one type...
const schema = TJS.generateSchema(program, "Root", settings);
console.log(schema);
I think this will be fixed by updating the version of typescript used in the project. I'm also getting this error for other libraries that use newer types, like the new object type.
Uh oh!
There was an error while loading. Please reload this page.
Hey,
I'm getting this error from running TJS.generateSchema():
My code:
My
Json.ts
-looks like this:I'm using
[email protected]
.Any ideas? :)
The text was updated successfully, but these errors were encountered: