benawad / graphql-ts-server-boilerplate

A GraphQL server boilerplate made with Typescript, PostgreSQL, and Redis
693 stars 181 forks source link

Cannot find namespace 'GQL'. #14

Closed sjvasconcello closed 5 years ago

sjvasconcello commented 5 years ago

Hi there! I don't know if you know why this happen:

return new TSError(diagnosticText, diagnosticCodes) ^ TSError: ⨯ Unable to compile TypeScript: src/resolvers.ts(6,26): error TS2503: Cannot find namespace 'GQL'. src/resolvers.ts(9,40): error TS2503: Cannot find namespace 'GQL'.

I was following all the steps in your video and well i don't know what happen

/*Greadings from Chile :D thanks for your videos*/

benawad commented 5 years ago

Try adding the --files flag to ts-node https://github.com/benawad/graphql-ts-server-boilerplate/blob/master/package.json#L60

sjvasconcello commented 5 years ago

Amazing work it!! but the problem start when i use ncu -a there this appears:

graphql-import ^0.5.0 → ^0.7.1 typeorm 0.2.0 → 0.2.9 @types/node ^9.6.6 → ^10.12.17 ts-node 6.0.0 → 7.0.1 typescript 2.8.3 → 3.2.2 graphql-yoga ^1.9.2 → ^1.16.8

maybe @types/node change something. But thanks you :D

hammer1003 commented 5 years ago

Try adding the --files flag to ts-node https://github.com/benawad/graphql-ts-server-boilerplate/blob/master/package.json#L60

I found that it is okay for below: "test-server": "NODE_ENV=test ts-node-dev --respawn src/app.ts",

May I know the reason why and what did you fixed?

benawad commented 5 years ago

ts-node released a new version where it requires you to add that flag

hammer1003 commented 5 years ago

got it. Thank you Ben.

matthewboman commented 5 years ago

The error reappears when setting up setup.ts and callSetup.js but adding the --files flag to the "test" command returns the error: Unrecognized option "files"

benawad commented 5 years ago

@crashspringfield try NODE_ENV=test TS_NODE_FILES=true jest --forceExit

gengjiawen commented 5 years ago

Stay ts-node on 6.x works for me.