You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imagine I have a lerna repo w/ two packages a and b that depend on each other, and each depend on an external package from npm, c. If I bootstrap and then run code inside a, I will end up requiring two different copies of c - the one in packages/a/node_modules AND the one in packages/b/node_modules. This breaks any identity checks in c.
I'm running into this problem w/ graphql as the external dependency and a failing instanceof check.
One way to avoid this problem would be to add shared external dependencies to the root package.json, install them to node_modules, and link them from packages/a/node_modules and packages/b/node_modules in the same way that lerna links the internal dependencies.
Is this a change you would consider? Or is there another solution for this that I have overlooked?
changed the title [-]Linking modules by requiring local files breaks identity checks in external dependencies[/-][+]Cross linking packages breaks identity checks in external dependencies[/+]on Jun 5, 2016
Yeah I've run into this exact issue with React related stuff. I wouldn't mind adding a feature that allowed you to whitelist external dependencies that need to share a single instance that could be linked from the root node_modules.
I think we'd have to use actual symlinks though... which we may need to explore again
I run in this issue as I have multiple packages that depends on react. I used @charlieschwabacher solution with a fake react package and it works, but I hope a backed-in solution will come in future!
changed the title [-]Cross linking packages breaks identity checks in external dependencies[/-][+][Feature] Cross linking packages breaks identity checks in external dependencies[/+]on Nov 16, 2016
I took a look at #334 and it's been locked but left open.
Is this something anyone here thinks might be looked at again?
Is it something worth me looking into with a potential pull request?
I'm getting the feeling that if the maintainers have decided not to address on purpose, any pull request would probably get rejected, so just want to double check before I invest time into this.
Thanks for investing your time everyone, I love Lerna and appreciate the work everyone has put into it!
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Activity
[-]Linking modules by requiring local files breaks identity checks in external dependencies[/-][+]Cross linking packages breaks identity checks in external dependencies[/+]charlieschwabacher commentedon Jun 5, 2016
I was able to work around my issue by adding a dummy graphql package w/
package.json:
and index.js:
I would still love a cleaner solution, but this is at least a temporary fix.
hzoo commentedon Jun 5, 2016
Will link https://twitter.com/gr2m/status/738454783854563330 as a reference since it seems to be a general problem too
jamiebuilds commentedon Jun 6, 2016
Yeah I've run into this exact issue with React related stuff. I wouldn't mind adding a feature that allowed you to whitelist external dependencies that need to share a single instance that could be linked from the root
node_modules.I think we'd have to use actual symlinks though... which we may need to explore again
charlieschwabacher commentedon Jun 6, 2016
@thejameskyle - why do you say we would have to use symlinks?
jamiebuilds commentedon Jun 9, 2016
Because you would need to symlink it into each package.
rygine commentedon Jun 14, 2016
this would be fixed using the updated bootstrapping process i've created, as long as they share the same version of the external dependency.
more info here: #215
charlieschwabacher commentedon Jun 19, 2016
@thejameskyle what I mean is why symlinks here vs proxies for cross linking the local packages?
Update bootstrap command (fixes lerna#176, lerna#11)
Update bootstrap command (fixes lerna#176, lerna#11)
Update bootstrap command (fixes lerna#176, lerna#11)
Update bootstrap command (fixes lerna#176, lerna#11)
Update bootstrap command (fixes lerna#176, lerna#11)
Update bootstrap command (fixes lerna#176, lerna#11)
Update bootstrap command (fixes lerna#11, lerna#176)
16 remaining items
Update bootstrap command (fixes #11, #176) (#237)
gigabo commentedon Sep 8, 2016
Oh, this didn't actually wind up getting addressed by #237.
The functionality that was dropped is tracked in #334.
Update bootstrap command (fixes lerna#11, lerna#176) (lerna#237)
ingro commentedon Sep 29, 2016
I run in this issue as I have multiple packages that depends on
react. I used @charlieschwabacher solution with a fake react package and it works, but I hope a backed-in solution will come in future![-]Cross linking packages breaks identity checks in external dependencies[/-][+][Feature] Cross linking packages breaks identity checks in external dependencies[/+]gmmorris commentedon Jan 18, 2017
Just came across this issue myself after a whole day of debugging a problem >_<
I made a repo for reference and was about to open a new issue when I found this one (See here: https://github.com/gmmorris/potential-symbol-bug).
I took a look at #334 and it's been locked but left open.
Is this something anyone here thinks might be looked at again?
Is it something worth me looking into with a potential pull request?
I'm getting the feeling that if the maintainers have decided not to address on purpose, any pull request would probably get rejected, so just want to double check before I invest time into this.
Thanks for investing your time everyone, I love Lerna and appreciate the work everyone has put into it!
gigabo commentedon Jan 19, 2017
Hi @gmmorris thanks for bringing this back up. I've opened #507 to port hoisting back from Asini.
gmmorris commentedon Jan 19, 2017
@gigabo My pleasure, thank you. :)
I'll keep an eye on it. I've solved this manually for now, but obviously that's not a good long term solution.
SandroMachado commentedon Jun 19, 2017
Any updates on this issue?
photusenigma commentedon Jun 20, 2017
Also looking for an update. ?
evocateur commentedon Aug 31, 2017
This was fixed in #507 with the introduction of
--hoist.lock commentedon Dec 28, 2018
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.