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
- Fix error when it skips dts generation * Fixes https://github.com/piglovesyou/graphql-let/issues/118#issuecomment-657588066 * This was a regression in [here](https://github.com/piglovesyou/graphql-le... — committed to piglovesyou/graphql-let by piglovesyou 4 years ago
- Create a failing test to reproduce #118 https://github.com/piglovesyou/graphql-let/issues/118#issuecomment-667028475 by @marklawlor — committed to piglovesyou/graphql-let by piglovesyou 4 years ago
- Done. All passes! Fixes #118 — committed to piglovesyou/graphql-let by piglovesyou 4 years ago
- Fixes #118: Pick up only correspoinding dtsContents for target `.tsx`s * refac: use ExecContext for the common vars * fix: some invalid config in tsconfig.test — committed to piglovesyou/graphql-let by piglovesyou 4 years ago
- Fixes #118: Pick up only correspoinding dtsContents for target `.tsx`s * refac: use ExecContext for the common vars * fix: some invalid config in tsconfig.test — committed to piglovesyou/graphql-let by piglovesyou 4 years ago
- Fixes #118: Pick up only correspoinding dtsContents for target `.tsx`s * refac: use ExecContext for the common vars * fix: some invalid config in tsconfig.test saying "private name AsyncIteration" me... — committed to piglovesyou/graphql-let by piglovesyou 4 years ago
Confirming that the issue isn’t just the latest release, it occurs with both
v0.11.1andv0.11.0Downgrading back to
v0.10.0works as expectedReplicated issue using a slightly modified example here https://github.com/marklawlor/graphql-let-118
Points to note:
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.