-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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] RouteInfo.find() produces undefined items #20140
Comments
Looks like a duplicate of #20056? |
Yes, it is, but a more detailed one. I could close mine if it's desired. |
Yeah, if you could pull your comment over onto that thread, that would be helpful from a maintenance POV! Thank you! |
@chriskrycho 🤔 I think this is still an issue, maybe you wanted to close the other one ? Thank you @nelstrom for the detail, I was just bitten by this. I can't see what changes in the router lib could have caused this, but eventually the work done by @wagenet around better types. tildeio/router.js@c83aeed#r82130596, or maybe https://github.com/emberjs/ember.js/pull/19971/files could also have side effects ? It seems like the underlyning weak map does not have the correct keys to retrieve the route infos. But I don't think the changes in the types could have an impact. But other than that, for now I can't see what change in the commit could lead to this issue |
It is still an issue, yes; but it's the same issue as the other one. 😄 |
Yes, sorry, so that mean you close this one on purpose, right ? Even if it has more details than the other. In that case, should I put my comments in #20056 ? |
🐞 Describe the Bug
The documentation for the RouteInfo.find() method says:
Up until
v4.2
of Ember, this callback function worked as expected. Sincev4.3
of Ember, the callback sometimes produces anundefined
value for theitem
.🔬 Minimal Reproduction
I've created a minimal reproduction.
The
beforeModel
hook in the'accounts.account'
route demonstrates the bug:To exercise this code, check out the repository and run the tests.
😕 Actual Behavior
The
RouteInfo.find()
callback produces anundefined
value for theitem
.This screenshot was created while running the minimal reproduction against Ember 4.5.
🤔 Expected Behavior
The
RouteInfo.find()
callback should always provide a value for theitem
:This screenshot was created while running the minimal reproduction against Ember 4.2.
🌍 Environment
➕ Additional Context
We used
git bisect
to find the commit that introduced this problem. Here's the output from our bisect session:Git bisect output
We came across this bug while upgrading our Ember app from 4.2 to 4.3. Here's a (simplified) sample of the code that drew our attention to the issue:
As a work around, we've rewritten the call to
find()
as follows:The text was updated successfully, but these errors were encountered: