-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
External dependencies missing in projectGraph on Windows #19520
Comments
@AgentEnder Is there anything I can do to help with this? |
Just updated to nx@17.x.x and this is still an issue. So we're still stuck on 16.2.2. Is there any plan to make this work on Windows? I'm already offered to help, but I need support to get further. |
Okey, I finally found the issue! 🥳 But since I now have to push the I get this error: So I guess we have two issue here:
|
Make sure the lock file is regenerated. Follow the instructions here: Basically the lock file should include all the optional platform deps, so that the single lock file can be used on multiple systems. Otherwise, if you really want to keep the lock file in the gitignore, you could try adding it to the .nxignore file with |
We're using But I still get the same error. I've tried to clear the runner's cache as well. |
on the CI, can you try running For example, on my computer running the command on the nx repo, i get this result:
|
@Cammisuli: Not sure what going on, I just won't work with the package-lock.json. I've tried all that I can think of. Removing the package-lock file is the only thing I can get to work. But then the issue is that I don't have a package-lock file when building. So I end up with the same problem as locally and the loop is closed!
Installing it manually works:
It only worked until I tried to build:
This ended up working (but is of course a bad solution):
We need to use the |
Are the optional dependencies listed in the package-lock.json file? The fact that you can't find rollup's native binary either is suspicious of the package-lock. All the optional dependencies should be listed in the package-lock. For example this is how the nx ones look:
Other package's optional native binaries should be around the same area too. Did you try deleting node_modules + the package-lock and doing |
I am having the same problem with npm but it worked with yarn package manager as we have yarn.lock file. |
I switched our package manager to bun and having the same issue as it uses the bun/lockb file. |
I'm using |
Current Behavior
I'm currently investigating why module federation is broken in nx >= 16.8.1, #19121.
The root cause is that
externalModules
are missing in theprojectGraph
, so host/remote cannot share dependencies.After a lot of digging it seems like the reason is that the
WorkspaceContext
is missingexternalModules
.In nx@16.2.2 the external modules are added to the project graph by calling
buildNpmPackageNodes
.In nx@16.8.1 something called
getNxWorkspaceFilesFromContext
is used instead. It's using aWorkspaceContext
to retrieve theexternalModules
, but it's always empty.Since
WorkspaceContext
is created by a binary I'm not sure if I can investigate this further.But since this is only an issue on Windows and this is a native module I guess that it's not that far fetched that it could be the source of the issue.
Expected Behavior
WorkspaceContext should add npm dependencies as
externalModules
so it can be added to theprojectGraph
GitHub Repo
https://github.com/JonWallsten/nx-repro/tree/dynamic
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: