Graphback: Codegen - TypeError: loader.loaderId is not a function

Created on 1 Aug 2021  路  3Comments  路  Source: aerogear/graphback

  • Module: graphql-config
  • Version: 3.2.0
  • Node: 15.0.1 / Yarn: 1.22.10

Hello. I just installed graphback and trying to run codegen. But the command gives this error:

$ graphback generate && graphql codegen
Generation successful!
TypeError: loader.loaderId is not a function
    at /Users/emirhan/works/freelance/yars/node_modules/graphql-config/index.cjs.js:439:79
    at Array.some (<anonymous>)
    at LoadersRegistry.register (/Users/emirhan/works/freelance/yars/node_modules/graphql-config/index.cjs.js:439:28)
    at CodegenExtension (/Users/emirhan/works/freelance/yars/node_modules/@graphql-codegen/cli/index.cjs.js:302:24)
    at GraphQLExtensionsRegistry.register (/Users/emirhan/works/freelance/yars/node_modules/graphql-config/index.cjs.js:535:25)
    at /Users/emirhan/works/freelance/yars/node_modules/graphql-config/index.cjs.js:649:30
    at Array.forEach (<anonymous>)
    at new GraphQLConfig (/Users/emirhan/works/freelance/yars/node_modules/graphql-config/index.cjs.js:648:20)
    at Object.<anonymous> (/Users/emirhan/works/freelance/yars/node_modules/graphql-config/index.cjs.js:603:43)
    at step (/Users/emirhan/works/freelance/yars/node_modules/tslib/tslib.js:143:27)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I used graphback before and when I change my yarn.lock file with that project, this command works. But when I delete it and reinstall modules and after that rerun this command, I get this error.

I tried to find solutions on Google but there is no results.

bug

All 3 comments

Codegen is part of the graphqlcodegenerator project (outside graphback) we cannot fix issues there. I looks like bumping version of codegen fixes problem

But I just don't understand, why my other project is working. The whole project version is same. It works until I delete yarn.lock & node_modules and reinstall packages. Do you have any suggestion?

I've solved this issue. I installed graphql-codegen manually. And it worked.

Was this page helpful?
0 / 5 - 0 ratings