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

Ember 3.18 - Cycles in tags are not allowed [query params] #18981

Closed
lifeart opened this issue May 18, 2020 · 12 comments
Closed

Ember 3.18 - Cycles in tags are not allowed [query params] #18981

lifeart opened this issue May 18, 2020 · 12 comments

Comments

@lifeart
Copy link
Contributor

lifeart commented May 18, 2020

image

reproduction: https://ember-twiddle.com/4106c69bb441077e93a8fcbba5fb3620?openFiles=templates.application%5C.hbs%2C

click on link 1, click on 2, and check console

@gabrielgrant
Copy link

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

@chancancode
Copy link
Member

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 = '';
    }
  }
}

@arunyegappan
Copy link

I face the same issue. Any updates on this?

@s-chiriac
Copy link

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

@Samsinite
Copy link

Samsinite commented Oct 7, 2020

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

@rwjblue
Copy link
Member

rwjblue commented Oct 7, 2020

Ya, the fix introduced regressions that we are still working on fixing (#19178 fixed some, but introduced #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...

@anlumo
Copy link

anlumo commented Oct 28, 2020

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.

@javve
Copy link

javve commented Dec 4, 2020

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 () {})

@rwjblue
Copy link
Member

rwjblue commented Dec 4, 2020

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

@juan-m-medina
Copy link

Any hints on where to start looking if this issue happens while using 3.22?

@pzuraq
Copy link
Contributor

pzuraq commented Jan 29, 2021

@juan-m-medina creating a minimal reproduction would be ideal, this is a pretty advanced issue when it happens usually, the last time we found it out it was a really weird interaction between query parameters, computed properties, and tracked properties, essentially.

@jcardali
Copy link

jcardali commented Mar 3, 2021

Still seeing this in later 3.21 versions and 3.22 like @juan-m-medina, I at least have not found queryParam setups in our codebase similar to the ones described here or in #19078.

When I try to go to 3.24 LTS, I run into emberjs/data#7430.

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

No branches or pull requests