-
Notifications
You must be signed in to change notification settings - Fork 150
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
Adding a new package in a dependency breaks yalc #144
Comments
@aleclarson :- Could you have a look at this issue. We have taken dependency on yalc, and it is serving most of our use cases except this bug. We tried different ways at our end, but are not able to get a way around this bug. |
|
Yalc is very simple, (while |
@whitecolor :- let's take the above example, where package A is added as a yalc dependency in B. Now i add some package, let's say C in A, and did some code changes, and did yalc push to make the changes reflect in package B. Now when i go inside .yalc folder inside package B, i see the code changes getting reflected there. Now when i start the server in B, at run time i get error message :- |
Is there some command that we need to run before running yalc push, in case we do npm install 'Some package' in dependency (package A in above case). |
If you add a dependency to package you need to run install command in your project, yalc doesn't doen't this, there is a flag called |
I suspect the problem lies on the Yarn/NPM side, which seem to be caching Calling
@whitecolor, do you mind sharing with us, what's the logic behind simply calling |
@grebenyuksv-preply |
@whitecolor @grebenyuksv-preply :- Thanks for the response. Let me try both of the approaches , and i will get back to you. |
@whitecolor do you mean How would
|
@rahul22048 I've just discovered that there's no more |
Yes , i am trying to do exactly the same thing |
@grebenyuksv-preply :- I will try to install version '1.0.0-pre.35' and run the 'postupdate' command. On a side note if it works, would it make sense to include this in the current version? Because i feel this is going to be a very common scenario |
@rahul22048 makes sense to me but I'm not a maintainer :) @whitecolor would returning |
@grebenyuksv-preply :- In your post update statement And somehow reverting to version I found the following workaround:- First of all i reverted to latest version of yalc. After doing yalc push inside package A, i went to package B (in which A was yalc referred) and deleted the package-lock file altogether, and then did npm install . (earlier i was just doing npm install), and then checked package-lock file of B. Now the added dependency was getting reflected. @whitecolor :- I am not sure, is this an issue at yalc end or npm, from customer perspective ideal solution would be that package-lock file is also updated to reflect the added dependency. |
No I don't know what is
I don't get the issue. Yalc just copies the new content (including package.json with new deps). Then you should run install command in to get new deps installed. Doesn't this flow work? |
@whitecolor :- This flow doesn't work in cases when i add a package (let's say C inside A in above example), and then do yalc push (inside Package A above). Then the changes are not reflected correctly. Code changes are there, but the added dependency C inside A in not there in package-lock file in B. Did u get the complete picture of the issue now? |
Yes I think I have met the same issue.
So your C dep is not updated (on yarn install) in the root |
Neither Note, I understand this sounds a bit out of Yalc's scope, so I'm not suggesting to make it work. I do wonder, however:
I'm basically trying to leverage Yalc while building a CI/CD pipeline for this all. |
@grebenyuksv-preply |
That should be able to replace |
Yeah, |
I won't use Let's see if @rahul22048 needs anything else. |
|
I also had to clean up |
Why? |
Hmm I can't reproduce the issue with NPM I was having, looks like |
I think I will close it, reopen if needed. |
Let's say package A is added as a dependency in package B, and A is referred in B through yalc . Now when i add some package in A and make the corresponding changes in package A, and do yalc push to update the changes in package B. Code changes are reflected correctly in B, but it breaks at run time saying the package i added in A is not available. Is it a known issue?
The text was updated successfully, but these errors were encountered: