-
Notifications
You must be signed in to change notification settings - Fork 12
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
Trying to unregister a portal "${name}"
when PortalTarget tears down before next
.
#616
Comments
Looks like this is the same issue I have been seeing in fastboot mode here: #413 - however I do not transition to a different route (I haven't seen that issue in non fastboot mode though...). Also it only appears when there is content rendered inside the portal. Today I was finally debugging fastboot mode and I had very similar findings.
I am a bit puzzled why the destructor is being called before the stargate setup is completed - except that the app seems to be torn down before ember-stargate is done initializing itself fully. If I go back in the stacktrace, I end up in ember-app.js where the _destroy() method is called inside the visit() method. I also noticed that in ember-stargate Portals are not rendered in FastBoot mode - makes sense if the portal isn't even registered before the app is torn down. I just have no idea why this is happening. Probably the best way to fix this is by setting a destroyed flag in the destructor, so one can make the code in the next() method a noop and stop trying to destroy a portal that hasn't been registered yet? Otherwise wrapping the destructor content in next() as well might also work. Then the portal would likely be registered and very soon deregistered again. However, the question also comes up, why the next() block is needed in first place? Also that will not fix that fastboot is unable to render the portals - but just remove the error. @simonihmig any thoughts about that? |
I think the original bug report should get fixed by #644. Will look into the fastboot story next... |
Hi! I'm upgrading from
ember-stargate
0.2.0 to 0.4.3 (on Ember 3.24). It looks like this PR moved theregisterPortal
call into anext
call.This causes a bug when transitioning to my error route. When the
PortalTarget
first renders, it callsregisterPortal
. The transition to theerror
route happens before thenext
is called, andunregisterPortal
is called beforeregisterPortal
gets to thenext
call, which throws the error from the title.I'd be happy to work on a fix for this, but I'd like to do it in a way that makes sense. My first thought is to put the contents of
unregisterPortal
into anext
loop as well.The text was updated successfully, but these errors were encountered: