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

[Bug] Cannot read properties of undefined (reading 'shouldSupersede') #20051

Closed
Turbo87 opened this issue Apr 6, 2022 · 13 comments
Closed

[Bug] Cannot read properties of undefined (reading 'shouldSupersede') #20051

Turbo87 opened this issue Apr 6, 2022 · 13 comments

Comments

@Turbo87
Copy link
Member

Turbo87 commented Apr 6, 2022

🐞 Describe the Bug

When calling routerService.urlFor(...) the call throws the following error:

TypeError: Cannot read properties of undefined (reading 'shouldSupersede')
    at NamedTransitionIntent.applyToHandlers (http://localhost:4040/assets/vendor.js:58167:52)
    at NamedTransitionIntent.applyToState (http://localhost:4040/assets/vendor.js:58109:19)
    at PrivateRouter.generate (http://localhost:4040/assets/vendor.js:59134:26)
    at Router.generate (http://localhost:4040/assets/vendor.js:18718:38)
    at RouterService.urlFor (http://localhost:4040/assets/vendor.js:15630:27)
    at CatchAllRoute.urlForRouteInfo (webpack://cargo/./node_modules/ember-error-route/index.js?:84:24)
    at CatchAllRoute.serialize (webpack://cargo/./node_modules/ember-error-route/index.js?:60:21)

🔬 Minimal Reproduction

😕 Actual Behavior

The error page does not work properly.

🤔 Expected Behavior

The call does not fail and the error route is displayed correctly.

🌍 Environment

  • Ember: 4.3.0 (works fine in 4.2.0)
  • Node.js/npm: irrelevant
  • OS: irrelevant
  • Browser: irrelevant

➕ Additional Context

This is most likely related to the changes that were introduced in #19971

/cc @wagenet

@wagenet
Copy link
Member

wagenet commented Apr 7, 2022

Ouch! Looks like we need more tests here. If you’re able to add some that would help speed up the debugging process.

sergiofenoll added a commit to kanselarij-vlaanderen/frontend-kaleidos that referenced this issue Apr 16, 2022
The session-kind test expects the PVV Ministerraad to come after the
normal Ministerraad in a filtered agendas table. With this new
default filtering, we explicitly apply this ordering.

An agendaitem delete call was causing errors which might be related to
these Ember bugs:

- emberjs/ember.js#20051
- emberjs/ember.js#19971

Leaving out setting anchor to null in hope that it might fix it.
@meirish
Copy link

meirish commented Jun 2, 2022

We're seeing this in 3.28 fwiw, but the trigger for us is a LinkTo with query params.

@fsmanuel
Copy link
Contributor

I have the same problem and could solve it by providing @models to LinkTo.

For example:

<LinkTo @models={{array this.model}} @query={{hash state=@state page=1}}>Label</LinkTo>

@chriskrycho
Copy link
Contributor

@meirish if you’re seeing it on 3.28 it’s probably a different specific bug. Can you create a new issue and a minimal reproduction? That would be super helpful.

@fsmanuel is that on 4.3+ or an earlier or later version where it first appears?

(Working on chipping away at this issue this week!)

@fsmanuel
Copy link
Contributor

@chriskrycho if i recall it correctly it started with 3.27 and still persists in 3.28
Haven't updated to 4.x yet

@chriskrycho
Copy link
Contributor

Thanks! As with @meirish's bug that's almost certainly a different bug than the one identified in this issue; if you can create a minimal reproduction that would be helpful. Thanks!

@fsmanuel
Copy link
Contributor

@chriskrycho ah you are right. I'll see what I can do.

@chriskrycho
Copy link
Contributor

I left a comment suggesting that we might have to revert #19971, but on digging further, I don't think that code path and this one intersect at all. It seems likelier that it's a result of the router.js refactors that landed in between. Investigating that now.

@chriskrycho
Copy link
Contributor

It is indeed the result of the router.js work; tildeio/router.js#329 introduced a bug which was fixed by tildeio/router.js#334, which we actually have on the beta branch via #20166—I’ve tested that change (by editing node_modules in the crates.io repo 😂) and it does indeed resolve it. I'll see if we can get the back-ports out tomorrow and this should be unblocked. 🎉

@Turbo87
Copy link
Member Author

Turbo87 commented Oct 12, 2022

sweeeeeet! thank you, Chris! ❤️

@chriskrycho
Copy link
Contributor

@Turbo87 if you can confirm once Renovate bumps that PR to use 4.7.1, I think we can close this out, as I published 4.4.3 LTS and 4.7.1 stable an hour ago! 🚀

@Turbo87
Copy link
Member Author

Turbo87 commented Oct 12, 2022

I can confirm that CI is green now. thanks again!

@Turbo87 Turbo87 closed this as completed Oct 12, 2022
@amk221
Copy link
Contributor

amk221 commented Mar 19, 2024

I have just migrated from Ember's LinkTo to our own Link component, (the exact same signature as LinkTo). Which hands off to the router service's urlFor method.

Since then, TypeError: undefined is not an object (evaluating 'f.shouldSupersede') has been showing up in our Sentry logs.

Ember ~5.5.0

stack
TypeError: undefined is not an object (evaluating 'f.shouldSupersede')
  at applyToHandlers(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:3230:105)
  at generate(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:3311:67)
  at generate(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:1637:36)
  at ke(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:650:73)
  at ? (/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2154:42)
  at ? (/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2780:6)
  at d(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2154:20)
  at Je(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2448:64)
  at flush(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2443:69)
  at ? (/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2379:14)
  at evaluate(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2272:21)
  at evaluateSyscall(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2560:69)
  at evaluateInner(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2554:153)
  at evaluateOuter(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2554:72)
  at next(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2615:39)
  at _execute(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2614:29)
  at handleException(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2565:77)
  at handleException(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2580:599)
  at throw(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2563:185)
  at evaluate(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2369:34)
  at _execute(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2563:22)
  at execute(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2561:110)
  at rerender(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2581:39)
  at ? (/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:454:37)
  at Dt(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2550:6)
  at _renderRoots(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:453:34)
  at _renderRootsTransaction(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:458:22)
  at _revalidate(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:460:314)
  at invokeWithOnError(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2910:200)
  at flush(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2902:75)
  at flush(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2915:212)
  at _end(/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2972:14)
  at ? (/a/ember/assets/vendor-2fe8c9a84ed109415b3e52cfec8f2a77.js:2924:609)

Linking #20663, in case its related.

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

7 participants