router icon indicating copy to clipboard operation
router copied to clipboard

Error: Exception thrown and not caught

Open abdonrd opened this issue 5 years ago • 10 comments

I just found a problem with the Vaadin Router; it doesn’t work in legacy browsers. The error is this: Exception thrown and not caught.

Screenshot 2020-10-13 at 17 20 39 (1)

Seems like it happens when the __addAppearingContent() call the this.__ensureOutlet() here: https://github.com/vaadin/vaadin-router/blob/c81fea90e19859ab28bebac72843bf0f68c6996b/src/router.js#L786

I’m using the @open-wc/building-rollup setup.

Repository: https://github.com/IBM/pwa-lit-template Live demo: https://pwa-lit-template.mybluemix.net

abdonrd avatar Oct 14 '20 08:10 abdonrd

If we go back to this PR from @web-padawan, it works again!

https://github.com/IBM/pwa-lit-template/pull/64

In this PR we defer setting outlet until app-index is rendered.

abdonrd avatar Oct 14 '20 08:10 abdonrd

Thanks for the issue. Do I understand correctly that my PR introduced a regression which only reproduces in old Edge?

I would appreciate a reduced test case that would help us to pinpoint the actual bug.

web-padawan avatar Oct 14 '20 08:10 web-padawan

Exactly!

If we go back with this changes (revert-router branch), it works again:

Screenshot 2020-10-14 at 10 48 03

abdonrd avatar Oct 14 '20 08:10 abdonrd

Logging the __ensureOutlet method.

console.log('__ensureOutlet', outlet);

Chrome:

Screenshot 2020-10-14 at 11 06 21

Edge:

Screenshot 2020-10-14 at 11 06 26

abdonrd avatar Oct 14 '20 09:10 abdonrd

Any news about this from the Vaadin team?

abdonrd avatar Nov 25 '20 21:11 abdonrd

Hi @abdonrd, do I understand correctly that this error only happens in legacy browsers? If this is the case, unfortunately, we decided to align the browser support with Vaadin, which means that we won't fix if the bug is only on old Edge. But if it also happens on the latest Edge, then we definitely should fix it.

haijian-vaadin avatar Nov 26 '20 08:11 haijian-vaadin

We found out because Rendertron stopped working for us.

And we have been able to reproduce it in browsers such as:

photo_2020-11-26 12 02 18

abdonrd avatar Nov 26 '20 11:11 abdonrd

Since I see movement in the project... (thanks! 🎉 )

@Haprog @platosha @vlukashov @haijian-vaadin could you help us with this? We have a proposal here: https://github.com/IBM/pwa-lit-template/pull/179

Thanks in advance!

abdonrd avatar Feb 02 '21 08:02 abdonrd

Did I understand right that this affects only old Edge (non-Chromium)? And maybe IE11? And there is a workaround that works?

I think it's unlikely that we would fix this since we're now targeting support for modern browsers only. See https://github.com/vaadin/vaadin-router/pull/548/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5

Haprog avatar Feb 02 '21 11:02 Haprog

@Haprog we found out because Rendertron (puppeteer & chrome-launcher) stopped working for us since https://github.com/IBM/pwa-lit-template/pull/64.

And we have been able to reproduce it in browsers such Edge, but I'm not sure.

A workaround that seems to work is https://github.com/IBM/pwa-lit-template/pull/179.

abdonrd avatar Feb 02 '21 12:02 abdonrd