Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webapp-api-client:graphql:generate-types Unable to find Codegen config file! #410

Open
Crunchyman-ralph opened this issue Sep 29, 2023 · 4 comments

Comments

@Crunchyman-ralph
Copy link

Describe the bug

when running: pnpm nx run webapp-api-client:graphql:generate-types at the root of the project,

it says:

Error: Unable to find Codegen config file! 
        Please make sure that you have a configuration file under the current directory!

More details:

 >  NX   Ran target graphql for project webapp-api-client (943ms)
 
    ✖    1/1 failed
    ✔    0/1 succeeded [0 read from cache]

Steps to reproduce

  1. Create a template from scratch
  2. Run pnpm install
  3. Run pnpm nx run webapp-api-client:graphql:generate-types

System Info

System:
    OS: macOS 14.0
    CPU: (12) arm64 Apple M2 Pro
    Memory: 41.06 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.volta/tools/image/node/18.15.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 9.6.2 - ~/.volta/tools/image/npm/9.6.2/bin/npm
    pnpm: 6.11.0 - ~/.volta/tools/image/node/18.15.0/bin/pnpm
  Browsers:
    Chrome: 117.0.5938.132
    Safari: 17.0
  npmPackages:
    @apollo/client: ^3.8.4 => 3.8.4 
    @apollo/rover: ^0.19.0 => 0.19.0 
    @aws-sdk/client-cloudformation: ^3.414.0 => 3.414.0 
    @aws-sdk/client-codebuild: ^3.414.0 => 3.414.0 
    @aws-sdk/client-ecr: ^3.414.0 => 3.414.0 
    @aws-sdk/client-ecs: ^3.414.0 => 3.414.0 
    @aws-sdk/client-iam: ^3.414.0 => 3.414.0 
    @aws-sdk/client-s3: ^3.417.0 => 3.417.0 
    @aws-sdk/client-ses: ^3.414.0 => 3.414.0 
    @aws-sdk/client-sfn: ^3.414.0 => 3.414.0 
    @aws-sdk/client-sts: ^3.414.0 => 3.414.0 
    @babel/preset-react: ^7.22.15 => 7.22.15 
    @graphql-codegen/cli: ^5.0.0 => 5.0.0 
    @graphql-typed-document-node/core: ^3.2.0 => 3.2.0 
    @iconify-icons/ion: ^1.2.10 => 1.2.10 
    @iconify/react: ^4.1.1 => 4.1.1 
    @nx/devkit: 16.8.1 => 16.8.1 
    @nx/eslint-plugin: 16.8.1 => 16.8.1 
    @nx/jest: 16.8.1 => 16.8.1 
    @nx/js: 16.8.1 => 16.8.1 
    @nx/linter: 16.8.1 => 16.8.1 
    @nx/node: 16.8.1 => 16.8.1 
    @nx/plugin: 16.8.1 => 16.8.1 
    @nx/react: 16.8.1 => 16.8.1 
    @nx/web: 16.8.1 => 16.8.1 
    @nx/webpack: 16.8.1 => 16.8.1 
    @sb/cli: * => 2.2.0 
    @sb/core: * => 2.2.0 
    @sentry/react: ^7.70.0 => 7.70.0 
    @storybook/addon-actions: ^7.4.3 => 7.4.3 
    @storybook/react: ^7.4.3 => 7.4.3 
    @supercharge/strings: ^2.0.0 => 2.0.0 
    @svgr/webpack: ^8.1.0 => 8.1.0 
    @tailwindcss/typography: ^0.5.10 => 0.5.10 
    @testing-library/dom: ^9.3.3 => 9.3.3 
    @testing-library/jest-dom: ^6.1.3 => 6.1.3 
    @testing-library/react: 14.0.0 => 14.0.0 
    @testing-library/react-hooks: ^8.0.1 => 8.0.1 
    @testing-library/user-event: ^14.5.1 => 14.5.1 
    @trivago/prettier-plugin-sort-imports: ^4.2.0 => 4.2.0 
    @types/gtag.js: ^0.0.14 => 0.0.14 
    @types/jest: ^29.5.5 => 29.5.5 
    @types/node: ^18.15.3 => 18.17.17 
    @types/ramda: ^0.28.25 => 0.28.25 
    @types/react: 18.2.22 => 18.2.22 
    @types/react-dom: 18.2.7 => 18.2.7 
    @types/react-router: ^5.1.20 => 5.1.20 
    @types/react-router-dom: 5.3.3 => 5.3.3 
    @types/react-test-renderer: ^18.0.2 => 18.0.2 
    @typescript-eslint/eslint-plugin: 5.62.0 => 5.62.0 
    @typescript-eslint/parser: 5.62.0 => 5.62.0 
    @typescript-eslint/scope-manager: 5.62.0 => 5.62.0 
    @vitejs/plugin-react: ^4.0.4 => 4.0.4 
    aws-cdk: ^2.96.2 => 2.96.2 
    aws-cdk-lib: ^2.96.2 => 2.96.2 
    babel-jest: 29.7.0 => 29.7.0 
    constructs: ^10.2.70 => 10.2.70 
    eslint: ^8.49.0 => 8.49.0 
    eslint-config-prettier: ^9.0.0 => 9.0.0 
    eslint-import-resolver-typescript: ^3.6.0 => 3.6.0 
    eslint-plugin-formatjs: ^4.10.5 => 4.10.5 
    eslint-plugin-import: 2.28.1 => 2.28.1 
    eslint-plugin-jsx-a11y: ^6.7.1 => 6.7.1 
    eslint-plugin-react: 7.33.2 => 7.33.2 
    eslint-plugin-react-hooks: 4.6.0 => 4.6.0 
    eslint-plugin-testing-library: ^6.0.1 => 6.0.1 
    graphql: ^16.8.1 => 16.8.1 
    husky: ^8.0.3 => 8.0.3 
    jest: 29.7.0 => 29.7.0 
    jest-environment-jsdom: 29.7.0 => 29.7.0 
    jest-matcher-utils: ^29.7.0 => 29.7.0 
    jest-watch-typeahead: ^2.2.2 => 2.2.2 
    lint-staged: ^14.0.1 => 14.0.1 
    nx: 16.8.1 => 16.8.1 
    nx-cloud: 16.4.0 => 16.4.0 
    plop: ^4.0.0 => 4.0.0 
    prettier: ^3.0.3 => 3.0.3 
    prettier-plugin-tailwindcss: ^0.5.4 => 0.5.4 
    ramda: ^0.28.0 => 0.28.0 
    react: 18.2.0 => 18.2.0 
    react-dom: 18.2.0 => 18.2.0 
    react-helmet-async: ^1.3.0 => 1.3.0 
    react-hook-form: ^7.46.1 => 7.46.1 
    react-intl: ^6.4.7 => 6.4.7 
    react-loading-skeleton: ^3.3.1 => 3.3.1 
    react-markdown: ^8.0.7 => 8.0.7 
    react-router: ^6.16.0 => 6.16.0 
    react-router-dom: 6.16.0 => 6.16.0 
    regenerator-runtime: ^0.14.0 => 0.14.0 
    styled-components: 6.0.8 => 6.0.8 
    tailwindcss: ^3.3.3 => 3.3.3 
    tailwindcss-animate: ^1.0.7 => 1.0.7 
    ts-jest: 29.1.1 => 29.1.1 
    ts-node: 10.9.1 => 10.9.1 
    tsconfig-paths: ^4.2.0 => 4.2.0 
    tslib: ^2.6.2 => 2.6.2 
    typescript: 5.2.2 => 5.2.2 
    vite: ^4.4.9 => 4.4.9 
    vite-plugin-eslint: ^1.8.1 => 1.8.1 
    vite-plugin-svgr: ^3.3.0 => 3.3.0 
    vite-tsconfig-paths: ^4.2.1 => 4.2.1

Logs

Click to expand! ```shell > nx run webapp-api-client:graphql:generate-types

/Users/ralphkhreish/workspace/freelance/toptal/the-fui/packages/webapp-libs/webapp-api-client

@sb/[email protected] graphql-codegen /Users/ralphkhreish/workspace/freelance/toptal/the-fui/packages/webapp-libs/webapp-api-client
graphql-codegen "./graphql/codegen.ts"
Error: Unable to find Codegen config file!
Please make sure that you have a configuration file under the current directory!

at loadContext (/Users/ralphkhreish/workspace/freelance/toptal/the-fui/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@graphql-codegen/cli/cjs/config.js:94:15)
at async createContext (/Users/ralphkhreish/workspace/freelance/toptal/the-fui/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@graphql-codegen/cli/cjs/config.js:190:21)
at async runCli (/Users/ralphkhreish/workspace/freelance/toptal/the-fui/node_modules/.pnpm/@[email protected]_@[email protected][email protected][email protected]/node_modules/@graphql-codegen/cli/cjs/cli.js:37:21)

 ERROR  Command failed with exit code 1.
Warning: run-commands command "pwd && pnpm run graphql-codegen -c ./graphql/codegen.ts" exited with non-zero status code

———————————————————————————————————————————————————————————————————————————————

NX Ran target graphql for project webapp-api-client (943ms)

✖    1/1 failed
✔    0/1 succeeded [0 read from cache]
</details>

### Validations

- [X] Follow our [Code of Conduct](https://github.com/apptension/saas-boilerplate/blob/master/CODE_OF_CONDUCT.md).
- [X] Read the [Contributing Guidelines](https://github.com/apptension/saas-boilerplate/blob/master/CONTRIBUTING.md).
- [X] Read the [docs](https://docs.demo.saas.apptoku.com/).
- [X] Check that there isn't [already an issue](https://github.com/apptension/saas-boilerplate/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/apptension/saas-boilerplate/discussions) or join our [Discord Chat Server](https://discord.apptension.com).
@Crunchyman-ralph
Copy link
Author

Crunchyman-ralph commented Sep 30, 2023

fixed it by changing some stuff in the project.json and package.json

project.json:

+ "commands": ["pnpm run graphql-codegen"],
- "commands": ["pnpm run graphql-codegen -c ./graphql/codegen.ts"],

package.json:

+ "graphql-codegen": "graphql-codegen --config ./graphql/codegen.ts",
- "graphql-codegen": "graphql-codegen",

I could write up a tiny PR if this is helpful...

@pziemkowski
Copy link
Member

I'll verify if this happens on other machines as well and let you know!

@Crunchyman-ralph
Copy link
Author

Did you get a chance to verify ?

@mkleszcz
Copy link
Contributor

mkleszcz commented Dec 5, 2023

I don't have this issue on my machine on the latest master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants