Using <LinkTo> dynamic @route inside engines does not work as expected
See original GitHub issueI’ve an Ember app (3.16) containing an in-repo addon “ui” and an in-repo engine “admin”.
Both the app and the engine share this addon.
One of the components of the addon contains a dynamic <LinkTo>
usage like below:
{{#each @menuItems as |menuItem|}}
<div class="main-navbar-item">
{{#if menuItem.model}}
<LinkTo @route={{menuItem.route}} @model={{menuItem.model}}>
{{t menuItem.textKey}}
</LinkTo>
{{else}}
{{!-- Tried this approach as well
{{#link-to menuItem.route}}
{{t menuItem.textKey}}
{{/link-to}} --}}
<LinkTo @route={{menuItem.route}}>
{{t menuItem.textKey}}
</LinkTo>
{{/if}}
</div>
{{/each}}
Using this component inside the host app renders the links well and as expected. While trying to use the same component in the engine and rendering the same, throws the following error:
Error: Assertion Failed: You attempted to update `route` on `(unknown object)`, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
`route` was first used:
- While rendering:
----------------
unknownObject.route
...
Am I missing something or is this a bug?
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Dynamic Routing not working as expected #8278 - GitHub
I'm not using a custom server and this is a small static project, so I'm only using a few libraries. OS: [e.g. macOS,...
Read more >Dynamic Routing not properly linking to CSS and JS files
The second route however, does not work as expected. When trying to run the exact same method within the second route, I get...
Read more >Resolved Issues - TechLibrary - Juniper Networks
This section lists the issues fixed in Junos OS Release 20.3R1 for MX Series routers. ... When a dynamic list next hop is...
Read more >next.config.js: Redirects
Redirects allow you to redirect an incoming request path to a different destination path. To use Redirects you can use the redirects key...
Read more >Create a Classic VPN using dynamic routing - Google Cloud
This page describes how to use dynamic routing to create a Classic VPN gateway and one tunnel that uses the Border Gateway Protocol...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@buschtoens @villander can you please take a look at this issue and the PR made?
I submitted a PR to ember to fix this, can I get a review from people who are more familiar with engines?