Ember.js: Ember 3.18 - Cycles in tags are not allowed [query params]

Created on 18 May 2020  路  9Comments  路  Source: emberjs/ember.js

Bug Has Reproduction Query Params Regression Rendering

Most helpful comment

I face the same issue. Any updates on this?

All 9 comments

arg, think i've been running into this the past couple days thinking I was doing something silly. Any suggestions on a workaround?

Great reproduction @lifeart. I narrowed down the reproduction a little and left some comments on what I found, both in the template and in the controller code. This seems to specifically impact array-typed QPs backed by tracked properties, with links that uses the default QP value.

https://ember-twiddle.com/1390a8f5eefe3b9ce755944bf989afcc?openFiles=templates.application%5C.hbs%2C

I think this clearly seems like a bug, but if you are desperate for a work around, since the QP only affect array-typed QPs, I suppose you can do something like this to manually convert it into a string-typed QP to avoid the issue:

// Don't copy this code as-is, without testing, I just typed-out-loud on the issue thread!

class MyController extends Controller {
  queryParams = [{ _projects: 'projects' }];

  @tracked _projects = '';

  get projects() {
    if (this._projects === '') {
      return [];
    } else {
      return JSON.parse(`[${this._projects}]`);
    }
  }

  set projects(array) {
    if (Array.isArray(array) && array.length > 0) {
      this._projects = JSON.stringify(array).slice(1, -1);
    } else {
      this._projects = '';
    }
  }
}

I face the same issue. Any updates on this?

Is there any chance this will get looked at soon? I'd love to contribute, but I'm not familiar enough with the codebase to find a solution. It's preventing my team from upgrading to 3.20

Looks like a fix is in 3.21.2, just appears to need back-ported to the 3.20 LTS release (if possible).

Ya, the fix introduced regressions that we are still working on fixing (https://github.com/emberjs/ember.js/pull/19178 fixed some, but introduced https://github.com/emberjs/ember.js/issues/19179 which ATM is still unfixed) we can't backport to LTS until we have high confidence that we will not introduce a regression in the LTS...

I'm currently in the process of updating my application from ember 3.14 to 3.22. I get the same exception at the same place, but even when I disable all my query parameters for the whole application, it's still there.

Is there any other situation where this exception could be thrown? I'm working on a giant application here, so isolating anything is very difficult, and the stack trace doesn't tell me anything.

I got this error when I accidentally had made a computed property that depended on itself. This didn't generate an error in Ember <= 3.17

imageContainerSize: computed('imageContainerSize', 'minWidth', 'minHeight', function () {})

Ya, it is fixed in current releases (and back ported to 3.20).

Was this page helpful?
0 / 5 - 0 ratings