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

ERROR: You're not allowed to have more than one controller property map to the same query param key #589

Closed
fran-worley opened this issue Aug 8, 2020 · 4 comments · Fixed by #590
Labels

Comments

@fran-worley
Copy link

The PR here #588 seems to have unintended consequences with controller query params.

Since upgrading to v8.0.1 we're seeing this error:

ERROR: Uncaught Error: Assertion Failed: You attempted to generate a link for the "tasks" route, but did not pass the models required for generating its dynamic segments. Assertion Failed: You're not allowed to have more than one controller property map to the same query param key, but both tasks:dueStatus and tasks.index:dueStatus map to due-status. You can fix this by mapping one of the controller properties to a different query param key via the as config option, e.g. dueStatus: { as: 'other-dueStatus' }

For reference our controller def looks like this:

import Controller from '@ember/controller';

export default Controller.extend({
  queryParams: {
    dueStatus: "due-status"
  },
  dueStatus: null
});
@rwjblue
Copy link
Member

rwjblue commented Aug 8, 2020

Hmmm sorry about that @fran-worley, but thank you for reporting!

I'm trying to figure out why that would have caused the issue you are seeing. Anything special about your setup? Is there a file at app/tasks/index.js? Are you using pods (with or without a podModulePrefix)? Where on disk is that controller that you expect to get resolved?

@rwjblue rwjblue added the bug label Aug 8, 2020
@fran-worley
Copy link
Author

Nope - we've got nothing weird like that going on. I even ran a find and replace for due-status and that is the only file where it is mentioned.

I've reverted back to v8.0.0 and it's fixed the issue. We're on ember-source v3.20.3 just incase that is of relevance.

@Turbo87
Copy link
Member

Turbo87 commented Aug 8, 2020

@rwjblue if you need a reproduction, skylines-project/skylines#2119 is showing a similar issue

@rwjblue
Copy link
Member

rwjblue commented Aug 8, 2020

Ya I'll revert and re-release once I'm back to my computer. Then I can dig in without folks being affected...

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

Successfully merging a pull request may close this issue.

3 participants