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

Regression in extending from native classes #17809

Closed
boris-petrov opened this issue Mar 27, 2019 · 4 comments · Fixed by #17859
Closed

Regression in extending from native classes #17809

boris-petrov opened this issue Mar 27, 2019 · 4 comments · Fixed by #17859

Comments

@boris-petrov
Copy link
Contributor

boris-petrov commented Mar 27, 2019

ember new ember-cannot-extend-from-native-classes
cd ember-cannot-extend-from-native-classes

Add the following test to tests/unit/services/store-test.js:

import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
import EmberObject from '@ember/object';

class Model extends EmberObject {
}

module('Unit | Service | Some', function(hooks) {
  setupTest(hooks);

  return test('it works', function(assert) {
    var record = Model.extend().create();
    assert.equal(record.get('x'), undefined);
  });
});

And then ember test fails. This is due to @babel packages being at version 7.4.0. 7.3.4 works fine.

@Ehaic
Copy link

Ehaic commented Mar 29, 2019

Is there a workaround for this? Just changing the version number of babel in my package lock and rerunning npm install?

@boris-petrov
Copy link
Contributor Author

Yes, unfortunately the only workaround is changing the versions. But this is very error-prone as there are many packages. Also newer versions of ember-cli-babel also seem to prevent me from pinning babel packages... it's a mess. :(

@boris-petrov
Copy link
Contributor Author

boris-petrov commented Mar 30, 2019

The issue seems to be in @babel/preset-env 7.4.0. Adding this to package.json (when using yarn):

  "resolutions": {
    "@babel/preset-env": "7.3.4"
  }

Fixes the issue. I hope that helps to pinpoint the issue.

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

Successfully merging a pull request may close this issue.

4 participants