emberjs / ember-cli-babel

Ember CLI plugin for Babel
MIT License
153 stars 119 forks source link

V1Addon with ember-source@3.28 does not work with App with ember-source@v3.25 #431

Open NullVoxPopuli opened 2 years ago

NullVoxPopuli commented 2 years ago

I think it's because addons are resolving their capabilities local to them rather than the host app. because setComponentTemplate (used in the output of co-located components), is referenced as Ember._setComponentTemplate in the app, and in the addon, referenced as: _component.setComponentTemplate (an import from the module (and real modules don't exist until ember-source@3.27)).

shouldn't ember-cli-babel ignore whatever is going on in the addon, and determine ember-source version from the host app?

sly7-7 commented 2 years ago

specifically, I think this works with app with ember-source@3.25.3, but not with app with ember-source@3.25.4

NullVoxPopuli commented 2 years ago

I'll try 3.25.3 before attempting a PR

NullVoxPopuli commented 2 years ago

I have the same problem on 3.25.3

rwjblue commented 2 years ago

I don't understand the thing being reported here, can you be more specific? Have a reproduction?

rwjblue commented 2 years ago

FWIW, we do use whatever the project has (ember-source wise)

https://github.com/babel/ember-cli-babel/blob/315df8af07bdc755c7529578dd48f5e25e2930d9/index.js#L88

https://github.com/babel/ember-cli-babel/blob/315df8af07bdc755c7529578dd48f5e25e2930d9/lib/get-babel-options.js#L55

https://github.com/babel/ember-cli-babel/blob/315df8af07bdc755c7529578dd48f5e25e2930d9/lib/babel-options-util.js#L165-L166

https://github.com/babel/ember-cli-babel/blob/315df8af07bdc755c7529578dd48f5e25e2930d9/lib/babel-options-util.js#L133-L141

NullVoxPopuli commented 2 years ago

trying to get debug-info atm -- giving up on vscode on this machine :upside_down_face:

NullVoxPopuli commented 2 years ago

The surface issue I'm trying to address is this error:

Could not find module @ember/component imported from (my module)
NullVoxPopuli commented 2 years ago

ok, so after a bunch of debugging, I've determined that in booting my app,

rwjblue commented 2 years ago

can you make a repro? would it be a monorepo with two ember-source versions?

NullVoxPopuli commented 2 years ago

Seems related to: https://github.com/emberjs/ember.js/issues/19700

can you make a repro? would it be a monorepo with two ember-source versions?

yup, can do! :tada:

NullVoxPopuli commented 2 years ago

yup, can do!

turns out, it's not so easy! I'll have to compare my repro with whatever is going on with my work monorepo tomorrow

NullVoxPopuli commented 2 years ago

ooo, I did it. link here: https://github.com/NullVoxPopuli/repro-ember-pre-and-post-3-27-compat

@rwjblue ^

sly7-7 commented 2 years ago

Seems related to: emberjs/ember.js#19700

I just discover this issue, exact same for me, not working when my addon is linked (via yarn), but it works when referring the published addon.

betocantu93 commented 2 years ago

I'm facing this issue too, here's a repro https://github.com/prysmex/ember-eui/tree/update-3.24.0

  1. yarn
  2. cd site
  3. ember s

If you downgrade packages/core from ~3.27.2 to 3.26.2 it should work.