-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Pruned lock file generation with yarn "file:" and "link:" package dependencies #15020
Comments
Hey @cwoebker, Thank you for reporting this. You are correct, using In our repo, we have the same requirement and use // this
"@nrwl/devkit": "file:../devkit",
// becomes e.g.
"@nrwl/devkit": "15.7.0", But this is only for publishing which doesn't require lock file generation. For deployment, all the packages need to be deployed first so targeting local packages from your app would not make sense, unless you bundle them. In that case there should be some intermediate step that should modify Can you tell me what type of application you are having a problem with and what build executor you are using? |
In the meantime, can you try this workaround: module-federation/core#578? |
same for the using urls as versions. For example I want to use fork:
error:
Seems like your |
@meeroslav Thanks for the extensive comment from your end. By now we have integrated one linked dependency with a more integrated approach using WebPack and moved the other dependency to a published npm package since it did not contain any proprietary code anyways. Thanks a lot! |
@CyanoFresh this should actualy work. You can look at our tests targeting exactly these types of versions: You can see something like this in the root
becomes this in the pruned
Generating a lock file converts the repo URL to the exact commit. This is then used as the source for the pruned lock file. If your project has again path to repo branch, that would potentially result in different commit (version) so the pruning fails. Unfortunately, Nx cannot tell what is your intention since you might be having multiple versions of the same package pointing to the different branches:
|
I have fixed that by adding
Just looked that semver uses this format, tried and it works. Maybe someone will find this issue too |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
We are getting this error message
Expected Behavior
We would expect the package.json and yarn.lock files to be generated correctly and the build to succeed.
GitHub Repo
No response
Steps to Reproduce
We recently upgraded from NX 15.1.1 to 15.7.0 and think that the changes introduced with 15.3.1 and this issue #9761 are responsible.
We used to copy over the entire yarn.lock file manually to the different
dist/app
folders but now want to use the lock file pruning feature.Our package.json file contains a dependency like this:
We are getting this error message
If we use
file:
instead oflink:
we are getting the same issue. Seems like this dependency is removed completely while the lock file is being pruned.In the previous version of nx, we already faced the issue that the package.json file did not correctly reflect these dependencies but we were able to find a manual workaround.
Or are these local
file:
andlink:
dependencies simply not supported here?Nx Report
Failure Logs
No response
Additional Information
Thanks for taking a look here.
The text was updated successfully, but these errors were encountered: