question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using <LinkTo> dynamic @route inside engines does not work as expected

See original GitHub issue

I’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:closed
  • Created 4 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
abhilashlrcommented, Feb 25, 2020

@buschtoens @villander can you please take a look at this issue and the PR made?

0reactions
chancancodecommented, Oct 26, 2020

I submitted a PR to ember to fix this, can I get a review from people who are more familiar with engines?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found