Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't inherit models #94

Open
frysch opened this issue Apr 11, 2022 · 2 comments
Open

Can't inherit models #94

frysch opened this issue Apr 11, 2022 · 2 comments

Comments

@frysch
Copy link

frysch commented Apr 11, 2022

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

@jdoyle65
Copy link

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;
}

@les2
Copy link

les2 commented May 4, 2024

just ran into this. this error is pretty bad, IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants