nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.39k stars 2.33k forks source link

Unable to load schema from [user]/[repo]/node_modules/nx/schemas/nx-schema.json #18786

Open simeon-raykov opened 1 year ago

simeon-raykov commented 1 year ago

Current Behavior

After switching to yarn PnP zero install, I noticed that VSCode no longer locates files that were previously pointing to node_modules folder. How do we solve this problem?

Expected Behavior

NX.json / Project.json "$schema" property is pointing to a valid json file

GitHub Repo

No response

Steps to Reproduce

  1. Generate a brand new NX workspace.
  2. Switch to yarn PnP https://nx.dev/recipes/tips-n-tricks/yarn-pnp.
  3. Generate Next.JS app with the NX generator.
  4. Open project.json of the new app.
  5. The property "$schema" points to a json file in the node_modules folder.

Nx Report

Node   : 19.7.0
   OS     : darwin-arm64
   yarn   : 3.6.2

   nx                 : 16.7.2
   @nx/js             : 16.7.2
   @nx/jest           : 16.7.2
   @nx/linter         : 16.7.2
   @nx/cypress        : 16.7.2
   @nx/eslint-plugin  : 16.7.2
   @nx/next           : 16.7.2
   @nx/react          : 16.7.2
   @nx/storybook      : 16.7.2
   @nx/vite           : 16.7.2
   @nx/web            : 16.7.2
   nx-cloud           : 16.4.0-beta.1
   typescript         : 5.1.6
   ---------------------------------------
   Community plugins:
   @jscutlery/semver : 3.1.0

raykosim@K7Q944JT6X pokerstars-web-client %

Failure Logs

No response

Operating System

Additional Information

No response

FrozenPandaz commented 1 year ago

@meeroslav We discussed this issue. Did we have a solution for this issue?

meeroslav commented 1 year ago

Not really. Since there will be no nx package in the node_modules, we can perhaps point to an online version of it - https://www.runpkg.com/?nx@15.8.9/schemas/nx-schema.json or host it ourselves.

meeroslav commented 1 year ago

Another option would be to copy schemas on post-install to node_modules

KyorCode commented 11 months ago

Any update on this? #bump

github-actions[bot] commented 5 months ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏

raoulkent commented 4 months ago

I'm having the exact same issue. What is the proposed best practice for this? I'm guessing that this same issue occurs as soon as one generates anything really, which adds manual labour to the process.

latin-1 commented 3 months ago

What about making the schema available through a URL under nx.dev? For example, Biome has https://biomejs.dev/schemas/1.8.3/schema.json

lppedd commented 3 months ago

Yes I also agree that would be a nice idea.