mardi 28 août 2018

Ember: Cannot call writeWatching after the object is destroyed

Encountering the following error occurs when a user logs out and then uses the browser back button to return to a previous page:

Error: Assertion Failed: Cannot call writeWatching after the object is destroyed.

I'm unable to isolate the issue to a point where it is reproducible outside of its current context, a problem other developers (i.e. here and here) on Ember's GitHub repo have reported with regards to reproducibility.

From the call stack trace I conducted, I can say that the error is executed by the following Ember function:

  setDebugFunction('assert', function assert(desc, test) {
    if (!test) {
      throw new _emberDebugError.default('Assertion Failed: ' + desc);
    }

And that the call stack begins at this Ember function:

onUpdateURL: function (callback) {
      var _this = this;

      this._removeEventListener();

      this._popstateHandler = function () {
        // Ignore initial page load popstate event in Chrome
        if (!popstateFired) {
          popstateFired = true;
          if (_this.getURL() === _this._previousURL) {
            return;
          }
        }
        callback(_this.getURL());
      };

      window.addEventListener('popstate', this._popstateHandler);
    }, 

However, I'm at a complete loss as to why this is occurring. Any insight would be much appreciated




Aucun commentaire:

Enregistrer un commentaire