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

Attempted to access the computed <Obj>.computedPropName on a destroyed object errors in acceptance tests after running this codemod #292

Open
tomwayson opened this issue Apr 23, 2020 · 2 comments

Comments

@tomwayson
Copy link

After running this codemod and cleaning up linting, unit, and integration test errors, I'm left w/ a couple of consistently failing acceptance tests w/ errors that look like:

Error: Assertion Failed: Attempted to access the computed <opendata-ui@service:app-settings::ember12998>.isHub on a destroyed object, which is not allowed
     at assert (https://localhost:4201/assets/vendor.js:52828:15)     at ComputedProperty.get (https://localhost:4201/assets/vendor.js:32061:120)
     at AppSettingsService.CPGETTER_FUNCTION [as isHub] (https://localhost:4201/assets/vendor.js:30210:25)
     at ActionsMenuService.getFollowButtonConfig (https://localhost:4201/assets/opendata-ui.js:40260:9)
     at ActionsMenuService.getConfig (https://localhost:4201/assets/opendata-ui.js:40204:39)
     at async Class.setActionsMenuConfig (https://localhost:4201/assets/opendata-ui.js:31149:22)

Here's the diff from before/after running the codemod for that CP:

-  }),
-  isHub: computed('hubCommunity.orgId', 'isUmbrella', 'session.portal', function () {
+  }
+
+  @computed('hubCommunity.orgId', 'isUmbrella', 'session.portal')
+  get isHub() {
     const isHub = !!this.get('hubCommunity.orgId') && !this.isUmbrella;
     return isHub;

If I change that to:

  get isHub () {
    return false;
  }

Then when the tests re-run it throws a similar error for a different CP on a different service.

Seems to come from https://github.com/emberjs/ember.js/blob/v3.16.6/packages/@ember/-internals/metal/lib/computed.ts#L615

Any ideas?

@jayeshgiramkar
Copy link

Any updates on this, cause I am facing a similar issue.

@richgt
Copy link

richgt commented Sep 27, 2022

Curious if anyone found a solution to this - I'm having similar problems when manually converting some things to native classes (don't think it's just the codemod that causes the problem).

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