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

Generators don't work when using pnpm catalogs #29772

Open
4 tasks
comp615 opened this issue Jan 28, 2025 · 0 comments
Open
4 tasks

Generators don't work when using pnpm catalogs #29772

comp615 opened this issue Jan 28, 2025 · 0 comments

Comments

@comp615
Copy link

comp615 commented Jan 28, 2025

Current Behavior

Running the example code:
nx g plugin my-plugin --directory=libs --importPath=@squareup/my-plugin

yields:
Error: The package.json lists a version of typescript that Nx is unable to validate - (catalog:)

This is because the generators use a check of the TS version which simply gets the entry from package.json and does not resolve catalogs from pnpm:

async function getInstalledTypescriptVersion(

Expected Behavior

A helper should be employed in the various places NX tries to resolve a version string from the package.json to resolve the "real" version using pnpm for checks like this to enable fuller support for pnpm as the package manager.

GitHub Repo

No response

Steps to Reproduce

package.json:

"devDependencies": {
    "typescript": "catalog:",
}

pnpm-workspace.yaml:

catalog:
  typescript: ~5.5.2

Nx Report

NX   Report complete - copy this into the issue template

Node           : 22.9.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 9.11.0

nx                     : 20.3.2
@nx/js                 : 20.3.2
@nx/jest               : 20.3.2
@nx/eslint             : 20.3.2
@nx/workspace          : 20.3.2
@nx/cypress            : 20.3.2
@nx/devkit             : 20.3.2
@nx/eslint-plugin      : 20.3.2
@nx/module-federation  : 20.3.2
@nx/plugin             : 20.3.2
@nx/react              : 20.3.2
@nx/storybook          : 20.3.2
@nx/vite               : 20.3.2
@nx/web                : 20.3.2
typescript             : 5.5.4
---------------------------------------
Registered Plugins:
@nx/vite/plugin
@nx/storybook/plugin

Failure Logs

Package Manager Version

9.11.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

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

No branches or pull requests

3 participants