Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[0.7.2] Cannot read property 'name' of null #323

Closed
boris-petrov opened this issue Jun 12, 2019 · 27 comments · Fixed by #324
Closed

[0.7.2] Cannot read property 'name' of null #323

boris-petrov opened this issue Jun 12, 2019 · 27 comments · Fixed by #324

Comments

@boris-petrov
Copy link

Thanks for fixing the other issue. The new version, however, has a similar issue:

Uncaught (in promise) TypeError: Cannot read property 'name' of null
    at nestedRouteNames (route-styles.js:27)
    at RouterService.<anonymous> (route-styles.js:14)
    at sendEvent (metal.js:345)
    at RouterService.trigger (evented.js:110)
    at Class.<anonymous> (router.js:80)
    at sendEvent (metal.js:345)
    at Class.trigger (evented.js:110)
    at router.js:185
    at invoke (backburner.js:335)
    at Queue.flush (backburner.js:226)
    at DeferredActionQueues.flush (backburner.js:423)
    at Backburner._end (backburner.js:957)
    at Backburner._boundAutorunEnd (backburner.js:626)

nestedRouteNames is called with transition.to which, again, is null.

@webark
Copy link
Owner

webark commented Jun 12, 2019

😱
I don’t understand how a “resolved transition” has no “to”. I’ll put some checks or catches in here, but i suspect something is wrong somewhere due transitions that are not setting their “to”

@webark
Copy link
Owner

webark commented Jun 12, 2019

or getting unset by something. I just feel you need a “to” to resolve a transition.

@boris-petrov
Copy link
Author

I also think like you, but... that's what happens. :( It might be a bug in Ember, not sure. But yes, for now a workaround would be nice. :)

@Duder-onomy
Copy link
Contributor

Duder-onomy commented Jun 14, 2019

Just experienced the exact same issue, downgrading to 0.6.9 fixed things.
Anything I can do to help?

@bitwolfe
Copy link

Yep, same issue here. This certainly is a weird one.

@webark
Copy link
Owner

webark commented Jun 14, 2019

had a swamped day today, sorry. Just need to put checks around it, and get a release out to unblock. Will get this out in the morning.

@lolmaus
Copy link

lolmaus commented Jun 20, 2019

Running into this also.

The transition is aborted.

image

@webark
Copy link
Owner

webark commented Jun 21, 2019

Sorry, got swamped by some things. I’ll get this check in.

and that line shouldn’t be triggering this, cause the to and from are set right below before they transition

@lolmaus
Copy link

lolmaus commented Jun 21, 2019

and that line shouldn’t be triggering this

My transition wasn't working, debugging led me to that abort method. Specifically, this.router.routeWillChange(transition); was crashing (the crash being swallowed somewhere) and causing a transition to a different route.

Downgrading ember-component-css from 0.7.1 back to 0.6.7 resolved the issue for me.

@webark
Copy link
Owner

webark commented Jun 22, 2019

@lolmaus @boris-petrov @Duder-onomy @bitwolfe released 0.7.3

I think this was happening when a transition is aborted when first loading the application and there isn't a from route yet. Does that sound like it? Like ember-simple-auth could be doing this if you are trying to access an authenticated route.

I didn't have that much time to a reproducible test, and wanted to get this out first (only had a few mins this morning). But we should get that in soon.

@webark
Copy link
Owner

webark commented Jun 22, 2019

sorry this took so long for me to get to 😞

@lolmaus
Copy link

lolmaus commented Jun 22, 2019

I think this was happening when a transition is aborted when first loading the application and there isn't a from route yet. Does that sound like it? Like ember-simple-auth could be doing this if you are trying to access an authenticated route.

Yes, that's our case.

@lolmaus
Copy link

lolmaus commented Jun 22, 2019

Uhm, on 0.7.3 I'm still seeing TypeError: Cannot read property 'name' of null in ember-component-css/instance-initializers/route-styles. 😐

@webark
Copy link
Owner

webark commented Jun 22, 2019

..??

@webark
Copy link
Owner

webark commented Jun 22, 2019

@lolmaus what line?

@lolmaus
Copy link

lolmaus commented Jun 22, 2019

@webark Same as in the top post.

@webark
Copy link
Owner

webark commented Jun 22, 2019

lines where added though.. can you paste the line from the code? (with like 2 above and 2 below)

@lolmaus
Copy link

lolmaus commented Jun 22, 2019

image

@webark
Copy link
Owner

webark commented Jun 22, 2019

ohhh.. default argument assignment only checks undefined and not null.. sometimes the whole null vs undefined thing is infuriating.. umm. well, i’m gone for the weekend, do this will have to wait till monday or sunday night :/ sorry.

@lolmaus
Copy link

lolmaus commented Jun 22, 2019

null is the worst mistake in computer science. :trollface:

@lolmaus
Copy link

lolmaus commented Jun 23, 2019

A proper test would be nice too.

PS Please reopen.

@Duder-onomy
Copy link
Contributor

Duder-onomy commented Jun 24, 2019

I can confirm that this happens on first entry into the application when that first transition is aborted.

@webark webark reopened this Jun 24, 2019
webark added a commit that referenced this issue Jun 24, 2019
@webark
Copy link
Owner

webark commented Jun 24, 2019

this should be fixed now with #326

@webark webark closed this as completed Jun 24, 2019
@webark
Copy link
Owner

webark commented Jun 24, 2019

ok. try 0.7.4 now.

Sorry for the back and forth with this.

@Duder-onomy
Copy link
Contributor

I can confirm 0.7.4 fixes things for me.

@webark
Copy link
Owner

webark commented Jun 29, 2019

sweet!

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

Successfully merging a pull request may close this issue.

5 participants