nx icon indicating copy to clipboard operation
nx copied to clipboard

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

Open simeon-raykov opened this issue 1 year ago • 8 comments

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

  • [X] macOS
  • [ ] Linux
  • [ ] Windows
  • [ ] Other (Please specify)

Additional Information

No response

simeon-raykov avatar Aug 23 '23 10:08 simeon-raykov

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

FrozenPandaz avatar Aug 23 '23 20:08 FrozenPandaz

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/[email protected]/schemas/nx-schema.json or host it ourselves.

meeroslav avatar Aug 28 '23 12:08 meeroslav

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

meeroslav avatar Aug 28 '23 12:08 meeroslav

Any update on this? #bump

KyorCode avatar Nov 06 '23 14:11 KyorCode

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! 🙏

github-actions[bot] avatar May 05 '24 00:05 github-actions[bot]

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.

raoulkent avatar May 23 '24 11:05 raoulkent

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

latin-1 avatar Jun 29 '24 17:06 latin-1

Yes I also agree that would be a nice idea.

lppedd avatar Jun 29 '24 19:06 lppedd