ember-cli / ember-cli-htmlbars

MIT License
77 stars 66 forks source link

Co-location gives `does not contain a default export` error when class is re-exported, but co-located template is present #771

Closed robinborst95 closed 1 year ago

robinborst95 commented 1 year ago

We have lots of components that have logic in a base backing class, but have different templates. When the template was still in templates/components, this worked perfectly fine, but after co-locating them, it breaks. This is the same issue as https://github.com/ember-cli/ember-cli-htmlbars/issues/389, but in our case there is a template and a co-located backing class that does export { default } from '...';.

robinborst95 commented 1 year ago

@bertdeblock @chriskrycho could any of you confirm this bug and my fix for it :pray:? After some prep work, we are quite eager to co-locate all our components, which is 1500+ changed files. However, this bug is a blocker for us, as we have quite a lot of components that do export { default } from ... in the backing class, but have their own template. Changing all of those to import Component from ... + export default class extends Component {} is time-consuming and it feels unnecessary since it just works perfectly with my fix.

But if there is a good reason why this would not be supported/recommended, then I'm curious to hear it too :+1:

bertdeblock commented 1 year ago

I'm not familiar with the internals of ember-cli-htmlbars, so I can't really confirm the bug, nor the fix. You could try reaching out on Discord in the #dev-ember-cli channel.