emberjs / ember-classic-decorator

MIT License
12 stars 22 forks source link

Ember-data classes no longer recognized on Ember 3.27 or later #80

Closed dwickern closed 2 years ago

dwickern commented 2 years ago

After upgrading to Ember 3.27, I get an error for each adapter and serializer, even though they extend from DS.Adapter and DS.Serializer, respectively:

Error while processing route: ... You defined the class app@serializer:my-model::constructor that extends from EmberObject using native class syntax, but you didn't mark it with the @classic decorator. All user classes that extend from this class must be marked as @classic, since they use classic features. If you want to remove the @classic decorator, you must remove the base class. For components, you can do this by converting to Glimmer components. For plain classes that extend from EmberObject, you can convert them into plain native classes that do not extend from EmberObject.

These modules no longer resolve: https://github.com/emberjs/ember-classic-decorator/blob/6d578829d8f193124c9379a03f315aa911def4f1/vendor/classic-decorator/index.js#L156-L157

dwickern commented 2 years ago

It was a conflict with ember-cli-shims

andreyfel commented 2 years ago

I've got the same issue, but I don't have ember-cli-shims.

In my case, it was a conflict with ember-cli-deprecation-workflow. I've specified in the package.json that ember-classic-decorator should go after ember-cli-deprecation-workflow: https://github.com/andreyfel/ember-classic-decorator/commit/f4a3fd00d289f1eede5542ab5fdb9f958d7ac0d1

@dwickern I'm curious how did you solve your issue?

dwickern commented 2 years ago

@andreyfel I confirmed that removing ember-cli-shims allows Resolver and DS to resolve. The shims dependency is from an ancient version of ember-cli-mirage, and there's no upgrade path so I'm stuck on Ember 3.26 for now.