emberjs / ember-render-modifiers

Implements did-insert / did-update / will-destroy modifiers for emberjs/rfcs#415
MIT License
86 stars 33 forks source link

Error: Invalid modifier manager compatibility specified #65

Closed richthedev closed 2 years ago

richthedev commented 2 years ago

Hi, I'm having some issues with the helpers when using the latest version (2.0.4) with Ember version 4.4.0. Using did-insert in a template triggers the following: Error: Invalid modifier manager compatibility specified.

richthedev commented 2 years ago

I created a new ember app from scratch and the helpers work fine. I will try to figure out what the problem is in my other app.

richthedev commented 2 years ago

If I inspect the did-insert modifier code, I can see the following:

capabilities: (0, _modifier.capabilities)('3.13', {
  disableAutoTracking: true
})

What factors in when trigerring between versions with the macro here:

capabilities: capabilities(
  macroCondition(dependencySatisfies('ember-source', '>= 3.22.0-beta.1')) ? '3.22' : '3.13',
  { disableAutoTracking: true }
)
SergeAstapov commented 2 years ago

@richthedev are you by any chance in the monorepo setup? looks like it's another peerDependencies issue causing the fuss here

richthedev commented 2 years ago

Yes this is a monorepo setup. How would I go about fixing this specific issue?

SergeAstapov commented 2 years ago

@richthedev if you use yarn, you may configure it to not hoist @ember/render-modifiers.

idea is that ember-source package listed as peerDependency in @ember/render-modifiers has to be exact same package and version resolved by the host app.

richthedev commented 2 years ago

@SergeAstapov I'm using npm. One thing I don't understand is in the other ember app I created from scratch and which is also a monorepo setup and uses the 4.7.0 ember version, the helpers work fine.

richthedev commented 2 years ago

I think I found the issue. I'm using another library ember-sortable that was requiring an older ember-modifier version.