emberjs/ember-classic-decorator

Can't inherit models

frysch opened this issue · 2 comments

Hi there.

It seems inheriting models is not allowed.

Example:

In foo.js:

import Model from '@ember-data/model';

export default class Foo extends Model {}

In foo-bar.js

import Foo from './foo';

export default class FooBar extends Foo {}

Then, when creating a FooBar: 💥
Screenshot 2022-04-11 at 09 10 42

Using 3.0.0 but tried out 2.0.1 with the same result, with Ember 3.28

Cheers!
Anders

I've encountered the same issue. Doing some testing it looks like this only occurs on models that don't contain any attributes. For example this produces an error:

import Model from '@ember-data/model';

export default class Foo extends Model {}

However this works just fine:

import Model, { attr } from '@ember-data/model';

export default class Foo extends Model {
  @attr bar;
}