I’m guessing you are using an identifier out of scope, and that’s compiling weird. Did you import the names of hasMany and attr, and such? Perhaps you are importing them like
import attr from 'ember-data';
This is incorrect. This sets the variable attr in this file as the default export of the ember-data package. If you want to import the thing namedattr in the ember-data package, use curly braces, like:
import {attr} from 'ember-data';
However, looking at the guides, you should actually import from the ember-data/relationships package: like:
import {attr} from 'ember-data/relationships';
Though personally, I do:
import DS from 'ember-data';
export default DS.Model.extend({
abc: DS.attr()
});
You can rename using this syntax:
import {attr as localNameForAttr} from 'ember-data/relationships';
export default Model.extend({
abc: localNameForAttr()
});
Which in words sets the variable localNameForAttr in this file as the thing exported with name attr from the package ember-data/relationships.