-
Notifications
You must be signed in to change notification settings - Fork 137
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
[Addon V2] Dependencies conflict between the addon and the test-app with the same package version for both (ember-source) #1602
Comments
I believe this is related to some of the info here: https://github.com/embroider-build/embroider/blob/main/docs/peer-dependency-resolution-issues.md
It's not enough to have the version match for any particular dependency, but when using peers, it's important that only one version is resolved (the version defined by the consumer). idk how many folks are familiar with peers, but I've found this document very helpful for myself: https://pnpm.io/how-peers-are-resolved |
Thanks for your answer @NullVoxPopuli 😄 . To be honest, I've already read the embroider docs and the pnpm docs you've sent. I still don't see why matching peers could be an issue if the version we want to use is already defined everywhere? Doesn't peerDeps act like a condition (i.e doesn't allow the installation if the version is too old) then when both I already also use I can close an issue as it's probably not embroider related and we certainly need more understanding to peer dependencies. I'll dig dipper and try to gain some expertise on that! |
well, I think this is still a problem that we, as a community, can make better -- we need to provide actionable next steps when encountering errors like this. Is the repo you're working with open source? I'd love to poke around and see if I can figure out if there is a way to automate away the error and report back with next steps -- (and then maybe there is a way to suggest those next steps when future error-viewers encounter what you've encountered).
It's a bit goofy, because peerDeps is a communication tool, but only protects you from the error if the devDep version is omitted (which most folks can't do because they need the types from their peerDep). One tool I like to use is, in a particular project, find out where my dep is. For example, I'll node -e "conosle.log(require.resolve('my peer dep name'));" To see what path node is discovering. I'm re-opening the issue, because I think there are DX improvements to be had here, and the main issue I see is that the error isn't clear enough nor does it provide action items. |
Alright 😄 Yes, it is open-source! You have to know that I've used your I've tried your command, here are the results: addon: So the only difference is that one is resolved with |
I think in this particular case, there was a bug in So, a couple action items we/i can add to the error:
|
Thanks for reporting this and thanks @NullVoxPopuli for investigating it. Everybody wants fast and reliable package management and the NPM ecosystem was... definitely not designed for that. So it's experiencing a lot of growing pains as both package authors and package managers start to actually get serious about correctness. So it's not at all unusual for embroider to be handed nonsense situations. That's why I added this error. Without it, you'd most likely just get a weirder error later in the build or at runtime. |
Thanks a lot @NullVoxPopuli, for enhancing the error and finding the issue! This is great 😄 |
Using
pnpm
, when installingember-source: ~5.2.0
in both addons and test-app, I got this error when launching tests:If it's helpful, I've logged the violations coming from
validatePeerDependencies
The only solution I've found is downgrading the addon
ember-source
version to~5.1.2
. Then it works.I thought this was an isolated incident, but some people also had the issue:
https://discord.com/channels/480462759797063690/1151598660505833525
If it's an error on our side, is it possible to add a clearer error message?
Thank you very much!
The text was updated successfully, but these errors were encountered: