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

Ember 2.8.0 error while hitting `view.parentView = null;` in `cleanupRenderNode` in ember-htmlbars #14266

Closed
josemariaruiz opened this Issue Sep 12, 2016 · 7 comments

Comments

Projects
None yet
2 participants
@josemariaruiz

josemariaruiz commented Sep 12, 2016

Hi,

I upgraded my app to 2.8.0 and now I get this error in the browser debugger.

ember.debug.js:6778 Uncaught Error: Assertion Failed: You must use Ember.set() to set theparentViewproperty (of <spa@component:md-card-content::ember940>) tonull.

This is interesting, as it's EmberJS telling me that something cannot be done (setting parentView directly) and yet ember-htmlbars does it.

Check

enifed('ember-htmlbars/hooks/cleanup-render-node', ['exports'], function (exports) {
  /**
  @module ember
  @submodule ember-htmlbars
  */

  'use strict';

  exports.default = cleanupRenderNode;

  function cleanupRenderNode(renderNode) {
    var view = renderNode.emberView;
    if (view) {
      view.renderer.willDestroyElement(view);
      view.ownerView._destroyingSubtreeForView.push(function (env) {
        view._transitionTo('destroying'); // unregisters view
        // prevents rerender and scheduling
        view._renderNode = null;
        renderNode.emberView = null;

        view.renderer.didDestroyElement(view);

        if (view.parentView && view.parentView === env.view) {
          view.parentView.removeChild(view);
        }
        view.parentView = null;

        view._transitionTo('preRender');
      });
    }

    if (renderNode.cleanup) {
      renderNode.cleanup();
    }
  }
});
@josemariaruiz

This comment has been minimized.

Show comment
Hide comment
@josemariaruiz

josemariaruiz Sep 12, 2016

I traced the problem back to the bower module (I don't know if that's the name) that you install with bower install.

The issue is described in this issue report: https://github.com/components/ember/issues/77

josemariaruiz commented Sep 12, 2016

I traced the problem back to the bower module (I don't know if that's the name) that you install with bower install.

The issue is described in this issue report: https://github.com/components/ember/issues/77

@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Sep 12, 2016

Member

This is a duplicate of #14260. As I mentioned in that issue, you should generally not be observing parentView. Can you provide a reproduction / example of what you are doing?

Member

rwjblue commented Sep 12, 2016

This is a duplicate of #14260. As I mentioned in that issue, you should generally not be observing parentView. Can you provide a reproduction / example of what you are doing?

@josemariaruiz

This comment has been minimized.

Show comment
Hide comment
@josemariaruiz

josemariaruiz Sep 12, 2016

A git grep in my source code shows no use of parentView so I assume that the problem in in a third party.

I'm not doing anything strange in particular, app relays on ember-cli-materialize and it has a component called md-card-content.

Running the same code with EmberJS 2.7.0 (that version works flawlessly) I've got this warning:

DEPRECATION: Theactivatorproperty of<spa@component:md-card-reveal::ember875>is anEmber.Bindingconnected toparentView.activator, butEmber.Bindingis deprecated. Consider using analiascomputed property instead. [deprecation id: ember-metal.binding] See http://emberjs.com/deprecations/v2.x#toc_ember-binding for more details.

josemariaruiz commented Sep 12, 2016

A git grep in my source code shows no use of parentView so I assume that the problem in in a third party.

I'm not doing anything strange in particular, app relays on ember-cli-materialize and it has a component called md-card-content.

Running the same code with EmberJS 2.7.0 (that version works flawlessly) I've got this warning:

DEPRECATION: Theactivatorproperty of<spa@component:md-card-reveal::ember875>is anEmber.Bindingconnected toparentView.activator, butEmber.Bindingis deprecated. Consider using analiascomputed property instead. [deprecation id: ember-metal.binding] See http://emberjs.com/deprecations/v2.x#toc_ember-binding for more details.

@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Sep 12, 2016

Member

Wherever md-card-reveal is defined, is where the observer on parentView is being used.

Member

rwjblue commented Sep 12, 2016

Wherever md-card-reveal is defined, is where the observer on parentView is being used.

@josemariaruiz

This comment has been minimized.

Show comment
Hide comment
@josemariaruiz

josemariaruiz Sep 12, 2016

For instance, this code?

  title: alias('parentView.title'),
  titleClass: alias('parentView.titleClass'),
  activator: alias('parentView.activator'),

josemariaruiz commented Sep 12, 2016

For instance, this code?

  title: alias('parentView.title'),
  titleClass: alias('parentView.titleClass'),
  activator: alias('parentView.activator'),
@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Sep 12, 2016

Member

Yes, exactly.

Member

rwjblue commented Sep 12, 2016

Yes, exactly.

@rwjblue rwjblue added this to the 2.8.0 milestone Sep 13, 2016

josemariaruiz added a commit to josemariaruiz/ember-cli-materialize that referenced this issue Sep 13, 2016

@rwjblue

This comment has been minimized.

Show comment
Hide comment
@rwjblue

rwjblue Sep 13, 2016

Member

Closed by #14281.

Member

rwjblue commented Sep 13, 2016

Closed by #14281.

@rwjblue rwjblue closed this Sep 13, 2016

jacobq added a commit to josemariaruiz/ember-cli-materialize that referenced this issue Jan 25, 2018

jacobq added a commit to josemariaruiz/ember-cli-materialize that referenced this issue Jan 25, 2018

jacobq added a commit to josemariaruiz/ember-cli-materialize that referenced this issue Jan 25, 2018

jacobq added a commit to josemariaruiz/ember-cli-materialize that referenced this issue Jan 25, 2018

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