#Peer dependency issue when using a local v2 addon in an app

1 messages Β· Page 1 of 1 (latest)

glossy oyster
#

I want to include a v2 addon I developed (called ember-metro-header-footer) in an app I'm developing (called metromap). I can't put the addon on NPM yet, so I'd like to use my local copy and npm link it to metromap. When I do this, I get the following error:

Some V1 ember addons are resolving as incorrect peer dependencies. This makes it impossible for us to safely convert them to v2 format.
See https://github.com/embroider-build/embroider/blob/main/docs/peer-dependency-resolution-issues.md for an explanation of the problem and suggestions for fixing it.

[email protected] (dev)-> [email protected]
sees peerDep [email protected]
at ...\GitProjects\metro-header-footer\node_modules\ember-source
but [email protected] is using [email protected]
at ...\GitProjects\metromap\node_modules\ember-source

[email protected] (dev)-> [email protected] -> @ember/[email protected]
sees peerDep [email protected]
at ...\GitProjects\metro-header-footer\node_modules\ember-source
but [email protected] is using [email protected]
at ...\GitProjects\metromap\node_modules\ember-source

[email protected] (dev)-> [email protected] -> [email protected]
sees peerDep [email protected]
at ...\GitProjects\metro-header-footer\node_modules\ember-source
but [email protected] is using [email protected]
at ...\GitProjects\metromap\node_modules\ember-source
(paths modified with "..." by me, but the metro-header-footer and metromap folders are siblings, just as they appear)

I've tried removing ember-source as a peer dependency from ember-metro-header-footer, but that doesn't seem to help. I've also tried adding it as a dev dependency. How can I get ember-metro-header-footer and its dependencies to use the same copy of ember-source as metromap?

NOTE: ember-metro-header-footer is in a monorepo with its test app, if that matters

chilly belfry
#

We have the same issue for one user, but not for another. Both are using pnpm.

lapis wedge
#

@glossy oyster assuming none of the workarounds from the linked document in the error worked?

lapis wedge
normal night
#

@glossy oyster I also have been confronted to this issue, but I've fixed it kind of randomly, so here's some hints if that made it work for me:
Move ember-source to your peerDeps in ember-metro-header-footer
As a peerDep, specify a lower or equal version of your ember-source package (i.e "ember-source": ">= 4.12.0" for instance)
Keep ember-source a devDependecy. If it still doesn't work, lower the version compared to your metromap (i.e 5.1.0). You can try to reupgrade it after it worked.
Maybe there is no direct links or I was too tired to remember what worked exactly, but I hope it will help you too!

#

Just rechecked, yup, the only solution I found for that is using a lower version in the addon compared to the app :/ Maybe there is an issue with the addon shim with strict comparison between versions?

chilly belfry
#

Thank you. I will give that a try now...

chilly belfry
#

I am very confused... it is still not working. I am sure this is my lack of knowledge:

[email protected] (dev)-> @kb/[email protected]
    sees peerDep [email protected]
      at /home/patrick/dev/ember-patrick/ember-patrick/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ember-concurrency
    but [email protected] is using [email protected]
      at /home/patrick/dev/ember-patrick/test-app/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/ember-concurrency

All the versions are matching, so why are they not resolving?

normal night
#

I think I'll create an issue @embroider explaining what's wrong. Even if it's a lack of knowledge, the error should be more helpful πŸ™‚

chilly belfry
#

Thank you very much πŸ™‚

normal night
chilly belfry
#

Brilliant. Really appreciate your help ⭐

glossy oyster
#

thank you for the effort on that issue @normal night!