vercel / next.js

The React Framework
https://nextjs.org
MIT License
127k stars 26.99k forks source link

graphql-let Error: Fails to generate .d.ts. #11688

Closed agarwalrounak closed 4 years ago

agarwalrounak commented 4 years ago

Bug report

Describe the bug

When trying to run with-typescript-graphql example with the command yarn dev, I get the following error:

yarn run v1.22.4
$ yarn codegen && next
$ graphql-let
[ graphql-let ] Generating .d.ts...
[ graphql-let ] Fails to generate .d.ts.Error: Fails to generate .d.ts.
    at Object.genDts (/home/rounak/Projects/with-typescript-graphql-app/node_modules/graphql-let/dist/lib/dts.js:45:15)
    at processDtsForCodegenContext (/home/rounak/Projects/with-typescript-graphql-app/node_modules/graphql-let/dist/lib/full-generate.js:73:31)
    at Object.fullGenerate [as default] (/home/rounak/Projects/with-typescript-graphql-app/node_modules/graphql-let/dist/lib/full-generate.js:87:15)
    at async gen (/home/rounak/Projects/with-typescript-graphql-app/node_modules/graphql-let/dist/gen.js:15:28)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

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

Expected behavior

After running yarn dev, the app should be available at localhost.

System information

lfades commented 4 years ago

Fixed by #11707. Please let us know if the issue persists

agarwalrounak commented 4 years ago

This works now. Thank you!

Rakhee06 commented 3 years ago

hi, I am facing this issue. I don't see the error though but .d.ts file doesn't get generated. I followed with-typescript-graphql example to setup my project. Heres my package.json and tsconfig.json file

package.json

"dependencies": { "@apollo/client": "~3.1.3", "@cadence-group/ui-core": "~0.67.2", "@cadence-group/ui-icons": "~0.13.4", "@cadence-group/ui-styles": "~0.12.3", "@graphql-tools/load-files": "6.0.18", "@graphql-tools/merge": "6.0.18", "@graphql-tools/schema": "6.0.18", "@material-ui/core": "~4.11.3", "@material-ui/icons": "~4.11.2", "@material-ui/lab": "~4.0.0-alpha.57", "@reduxjs/toolkit": "~1.6.0", "@types/react-redux": "~7.1.16", "ajv": "~7.1.1", "apollo-cache-inmemory": "~1.6.6", "apollo-link-http": "~1.5.17", "apollo-server-micro": "~2.16.1", "autosuggest-highlight": "~3.1.1", "date-fns": "~2.0.0-beta.5", "faker": "~5.4.0", "formik": "~2.2.6", "formik-material-ui": "~3.0.1", "graphql": "~15.3.0", "graphql-type-json": "~0.3.2", "invariant": "~2.2.4", "isomorphic-unfetch": "~3.1.0", "lodash": "~4.17.21", "material-table": "1.54.0", "moment": "~2.29.1", "next": "~11.0.1", "next-auth": "~3.3.0", "node-jose-tools": "~1.6.28", "numeral": "~2.0.6", "polished": "~4.1.1", "react": "~17.0.2", "react-dates": "~21.8.0", "react-dom": "~17.0.2", "react-input-mask": "~2.0.4", "react-markdown": "~5.0.3", "react-number-format": "~4.5.1", "react-phone-input-2": "~2.13.9", "react-redux": "~7.2.4", "uniforms": "~3.2.0", "uniforms-bridge-json-schema": "~3.2.0", "uniforms-material": "~3.2.0", "victory": "~35.4.10", "with-query": "~1.3.0", "xlsx": "~0.16.9", "yup": "~0.32.9" }, "devDependencies": { "@cadence-group/conventional-changelog-angular-jira": "~0.0.7", "@commitlint/cli": "~11.0.0", "@commitlint/config-angular": "~11.0.0", "@commitlint/config-conventional": "~11.0.0", "@digitalroute/cz-conventional-changelog-for-jira": "~6.0.2", "@emotion/eslint-plugin": "~11.0.0", "@graphql-codegen/cli": "~1.17.8", "@graphql-codegen/import-types-preset": "~1.18.2", "@graphql-codegen/plugin-helpers": "~1.17.8", "@graphql-codegen/typescript": "~1.17.8", "@graphql-codegen/typescript-operations": "~1.17.8", "@graphql-codegen/typescript-react-apollo": "~2.0.6", "@graphql-codegen/typescript-resolvers": "~1.17.8", "@semantic-release/changelog": "~5.0.1", "@semantic-release/commit-analyzer": "~8.0.1", "@semantic-release/exec": "~5.0.0", "@semantic-release/git": "~9.0.0", "@semantic-release/github": "~7.2.0", "@semantic-release/release-notes-generator": "~9.0.1", "@types/react": "~16.9.46", "@types/react-dom": "~16.9.8", "@types/react-test-renderer": "16.9.3", "@typescript-eslint/eslint-plugin": "~2.34.0", "@typescript-eslint/parser": "~2.34.0", "babel-jest": "26.3.0", "env-cmd": "~10.1.0", "eslint": "~7.11.0", "eslint-config-next": "~11.1.0", "eslint-config-prettier": "~8.1.0", "eslint-plugin-import": "~2.22.1", "eslint-plugin-jsx-a11y": "~6.4.1", "eslint-plugin-prettier": "~3.3.1", "eslint-plugin-react": "~7.22.0", "eslint-plugin-react-hooks": "~4.2.0", "graphql-let": "~0.18.0", "husky": "4.3.0", "jest": "26.4.0", "prettier": "~2.2.1", "react-test-renderer": "16.13.1", "semantic-release": "~17.3.0", "typescript": "~4.3.2", "yaml-loader": "0.6.0" },

tsconfig.json

{ "compilerOptions": { "allowJs": true, "alwaysStrict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, "jsx": "preserve", "lib": ["dom", "dom.iterable", "esnext"], "module": "esnext", "moduleResolution": "node", "noEmit": true, "noFallthroughCasesInSwitch": true, "noUnusedLocals": true, "noUnusedParameters": true, "resolveJsonModule": true, "skipLibCheck": true, "strict": true, "target": "esnext", "baseUrl": ".", "paths": { "~/": ["./"] }, }, "include": ["next-env.d.ts", "graphql.d.ts", "*/.ts", "*/.tsx"], "exclude": ["node_modules"], }

balazsorban44 commented 2 years ago

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.