dotansimha / graphql-code-generator

A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.
https://the-guild.dev/graphql/codegen/
MIT License
10.78k stars 1.32k forks source link

Unmet peer dependency ts-node #8462

Open markedwards opened 1 year ago

markedwards commented 1 year ago

Describe the bug

Yarn is spitting out the following complaint:

@graphql-codegen/cli > cosmiconfig-typescript-loader@4.0.0" has unmet peer dependency "ts-node@>=10".

Can graphql-code-generator resolve this dependency?

Your Example Website or App

--

Steps to Reproduce the Bug or Issue

  1. install graphql-code-generator according to README
  2. observe unmet peer dependency warning

Expected behavior

As a user, I don't know anything about this child dependency or what to do about it. I'd like graphql-code-generator to sort it out.

Screenshots or Videos

No response

Platform

Codegen Config File

No response

Additional context

No response

RIP21 commented 1 year ago

Confirm this one. Fails with pnpm too.

 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

../../apps/app
└─┬ @graphql-codegen/cli 2.13.5
  └─┬ cosmiconfig-typescript-loader 4.1.1
    └── ✕ missing peer ts-node@>=10
Peer dependencies that should be installed:
  ts-node@>=10  
lvauvillier commented 1 year ago

Confirm the issue with pnpm too.

Adding the following hook fixes the problem:

// file .pnpmfile.cjs
function readPackage(pkg, context) {
  if (pkg.name === "cosmiconfig-typescript-loader") {
    pkg.dependencies["ts-node"] = "^10.9.1";
  }
  return pkg;
}

module.exports = {
  hooks: {
    readPackage,
  },
};
GamerBene19 commented 1 year ago

Experiencing this issue aswell. I'm using yarn