graphql-let: Failed to generate .d.ts.Error: Failed to generate .d.ts.

Something in the new reslease broke the generation of .d.ts.

I’m getting the error

yarn run v1.22.4
$ graphql-let
[ graphql-let ] Generating .d.ts...
[ graphql-let ] Failed to generate .d.ts.Error: Failed to generate .d.ts.
    at Object.genDts (C:\Users\USER_NAME\client\node_modules\graphql-let\dist\lib\dts.js:71:15)
    at processDtsForCodegenContext (C:\Users\USER_NAME\client\node_modules\graphql-let\dist\lib\full-generate.js:97:31)
    at Object.fullGenerate [as default] (C:\Users\USER_NAME\client\node_modules\graphql-let\dist\lib\full-generate.js:112:15)
    at async gen (C:\Users\USER_NAME\client\node_modules\graphql-let\dist\gen.js:26:28)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! with-typescript-graphql@0.1.0 dev: `yarn codegen && next`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the with-typescript-graphql@0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\matthiass\AppData\Roaming\npm-cache\_logs\2020-07-10T16_41_33_559Z-debug.log

I just did a clean

yarn create next-app --example with-typescript-graphql with-typescript-graphql-app
yarn
yarn dev

Here is my package.json

{
  "name": "with-typescript-graphql",
  "version": "0.1.0",
  "author": "",
  "license": "ISC",
  "scripts": {
    "codegen": "graphql-let",
    "dev": "yarn codegen && next",
    "build": "yarn codegen && next build",
    "start": "next start"
  },
  "dependencies": {
    "@apollo/react-common": "3.1.4",
    "@apollo/react-components": "^3.1.5",
    "@apollo/react-hooks": "3.1.5",
    "apollo-cache": "^1.3.5",
    "apollo-cache-inmemory": "^1.6.6",
    "apollo-client": "^2.6.10",
    "apollo-link": "1.2.14",
    "apollo-link-http": "1.5.17",
    "apollo-link-schema": "1.2.5",
    "apollo-server-micro": "^2.14.2",
    "apollo-utilities": "^1.3.3",
    "graphql": "^14.6.0",
    "graphql-tag": "^2.10.3",
    "next": "latest",
    "react": "^16.13.1",
    "react-dom": "^16.13.1"
  },
  "devDependencies": {
    "@graphql-codegen/cli": "^1.15.1",
    "@graphql-codegen/plugin-helpers": "^1.15.1",
    "@graphql-codegen/typescript": "^1.13.3",
    "@graphql-codegen/typescript-operations": "^1.13.3",
    "@graphql-codegen/typescript-react-apollo": "^1.13.3",
    "@graphql-codegen/typescript-resolvers": "^1.15.1",
    "@types/react": "^16.9.34",
    "@types/react-dom": "^16.9.7",
    "graphql-let": "0.x",
    "typescript": "^3.8.3"
  }
}

On a windows machine with npm@latest

Reverting to graphql-let: "0.10.0" fixed the issue

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 19 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Confirming that the issue isn’t just the latest release, it occurs with both v0.11.1 and v0.11.0

Downgrading back to v0.10.0 works as expected

Replicated issue using a slightly modified example here https://github.com/marklawlor/graphql-let-118

Points to note:

  • Running graphql-let still generates the caches and .d.ts files, but exits with the error
  • The command graphql-let will only error when there is no generated folder
  • Removing the baseUrl option from tsconfig will stop the error, but I would expect this library to work regardless of this option

This issue happened to me yesterday when I had typescript files near the graphql schema. They were importing the graphql schema (not if this is important). After I put them in separate directories, the error went away. Weird.

I happened to have time and released v0.11.2. Thanks for commenting. Please reopen it if you still get trouble.