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

Error: "EmberObject.create no longer supports.." - only during embroider-safe scenario on Ember 4.12 addon (v1) #1599

Closed
Pixelik opened this issue Sep 13, 2023 · 1 comment

Comments

@Pixelik
Copy link

Pixelik commented Sep 13, 2023

I updated my Ember Addon (v1) to Ember 4.12.

The addon is using ember-cp-validations v5.

This is what my package.json looks like:

  "dependencies": {
    ...,
    "ember-cp-validations": "^5.0.0",
    ...
  },
  "devDependencies": {
    ...,
    "@babel/core": "^7.22.1",
    "@babel/eslint-parser": "^7.21.8",
    "@babel/plugin-proposal-decorators": "^7.21.0",
    ...,
    "@ember-intl/cp-validations": "^5.0.0",
    ...,
    "@embroider/test-setup": "^3.0.0",
    ...,
    "ember-auto-import": "^2.6.3",
    ...,
    "ember-qunit": "^6.2.0",
    "ember-resolver": "^10.0.0",
    "ember-source": "~4.12.0",
    ...,
    "qunit": "^2.19.4",
    ...,
    "webpack": "^5.0.0
  },
  "peerDependencies": {
    "ember-source": "^4.8.0"
  },
  "resolutions": {
    "@embroider/macros": "^1.12.2"
  }

Everything works and all tests are passing, except when running the embroider-safe scenario where this error is thrown:

Error: Assertion Failed: EmberObject.create no longer supports defining computed properties. Define computed properties using extend() or reopen() before calling create().
    at assert (http://localhost:4200/assets/test-support.js:233:15)
    at initialize (http://localhost:4200/assets/vendor.js:30952:81)
    at Class.create (http://localhost:4200/assets/vendor.js:31314:9)
    at new Options (webpack://dummy/../rewritten-packages/ember-cp-validations.126a452a/-private/options.js?:39:26)
    at Class.buildOptions (webpack://dummy/../rewritten-packages/ember-cp-validations.126a452a/validators/base.js?:130:12)
    at Class.init (webpack://dummy/../rewritten-packages/ember-cp-validations.126a452a/validators/base.js?:110:78)
    at Class.superWrapper [as init] (http://localhost:4200/assets/vendor.js:23897:22)
    at initialize (http://localhost:4200/assets/vendor.js:30988:9)
    at Class.create (http://localhost:4200/assets/vendor.js:31312:9)
    at InternalFactoryManager.create (http://localhost:4200/assets/vendor.js:13726:25)

I understand that the Error itself EmberObject.create no longer supports defining computed properties. is a known issue, but why am I getting it only during the embroider-safe test scenario?

Do you think I should open this issue on the ember-cp-validations repo instead ? But there really isn't anything wrong with ember-cp-validations v5 on Ember 4.12 with the default test scenario so..?

Any help would be much appreciated 🙏

@Pixelik Pixelik changed the title ember-cp-validations Error only during embroider-safe scenario on Ember 4.12 ember-cp-validations Error only during embroider-safe scenario on Ember 4.12 addon (v1) Sep 13, 2023
@Pixelik Pixelik changed the title ember-cp-validations Error only during embroider-safe scenario on Ember 4.12 addon (v1) Error: "EmberObject.create no longer supports defining computed properties." - only during embroider-safe scenario on Ember 4.12 addon (v1) Sep 14, 2023
@Pixelik Pixelik changed the title Error: "EmberObject.create no longer supports defining computed properties." - only during embroider-safe scenario on Ember 4.12 addon (v1) Error: "EmberObject.create no longer supports defining computed properties." - only during embroider-safe scenario on Ember 4.12 addon (v1) Sep 14, 2023
@Pixelik Pixelik changed the title Error: "EmberObject.create no longer supports defining computed properties." - only during embroider-safe scenario on Ember 4.12 addon (v1) Error: "EmberObject.create no longer supports.." - only during embroider-safe scenario on Ember 4.12 addon (v1) Sep 14, 2023
@Pixelik
Copy link
Author

Pixelik commented Sep 19, 2023

I'm closing this issue as the problem is coming from ember-cp-validations and I have opened a relevant issue & PR on that repo instead

@Pixelik Pixelik closed this as completed Sep 19, 2023
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

1 participant