Skip to content
Latchkey

GraphQL Code Generator "Unable to find Plugin" in CI

Each entry under plugins in codegen.yml maps to an npm package. If that package is not installed (missing from devDependencies, or npm ci did not run), the generator reports it cannot find the plugin and tells you to install it.

What this error means

graphql-codegen fails with "Unable to find Plugin \"typescript-operations\". Install the plugin via npm/yarn ..." and stops before generating.

graphql-codegen
Unable to find Plugin "typescript-operations". Install the plugin via npm/yarn:
        npm install --save-dev @graphql-codegen/typescript-operations

Common causes

The plugin package is not in dependencies

codegen.yml references a plugin whose @graphql-codegen/<name> package was never added, so a clean install does not provide it.

Dependencies were not installed before codegen ran

The job ran the generate step without a prior npm ci, so node_modules lacks the plugin.

How to fix it

Add the plugin and install dependencies

  1. Add the @graphql-codegen/<name> package to devDependencies.
  2. Run npm ci (or your package manager equivalent) before codegen.
  3. Re-run the generate step.
Terminal
npm install --save-dev @graphql-codegen/typescript-operations
npm ci
npx graphql-codegen

Order CI steps so install precedes generation

Make sure the codegen step depends on a completed dependency install.

.github/workflows/ci.yml
- run: npm ci
- run: npx graphql-codegen --config codegen.yml

How to prevent it

  • List every codegen plugin in devDependencies and commit the lockfile.
  • Run npm ci before any codegen step.
  • Pin plugin versions so generated output is reproducible.

Frequently asked questions

What causes ""Unable to find Plugin""?
codegen.yml references a plugin whose @graphql-codegen/<name> package was never added, so a clean install does not provide it.
How do I fix "Unable to find Plugin"?
Add the plugin and install dependencies

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card