Polymer / polymer

Our original Web Component library.
https://polymer-library.polymer-project.org/
BSD 3-Clause "New" or "Revised" License
22.05k stars 2.01k forks source link

Safari dom-if slot bug "A problem repeatedly occurred" #5689

Open dejan9393 opened 3 years ago

dejan9393 commented 3 years ago

Hi, there seems to be a bug on the latest version of Safari (14.1.1) when using dom-if with a certain configuration of slots.

I was able to create a minimal reproducible case, but i'm baffled because it seems like a very specific configuration to me.

The problem causes Safari to crash and automatically reload the page with the error "This webpage was reloaded because a problem occurred.". A subsequent error will reload the page again, this time with a black screen stating: "A problem repeatedly occurred with [url]"

Screen Shot 2021-05-31 at 10 51 59 am

I've made a minimal reproduction here:

https://safari-dom-if-bug.glitch.me/

source code is here: https://glitch.com/edit/#!/safari-dom-if-bug

The important snippet that i've narrowed it down to is the following:

element-with-slot.js:

<slot></slot>

app.js:

<element-with-slot>
  <template is="dom-if" if="[[boolean]]">
    <slot>Works!</slot>
  </template>
</element-with-slot>

<slot name="test"></slot>

The curious thing for me is that the snippet actually seems to work without that extra named-slot sibling ([name=test]) after the element-with-slot.

A workaround is to wrap the <dom-if> with something other than a slot (so that the dom-if is not a direct child of the element with a slot). This makes me wonder if this is related to #5065.

Any help appreciated!

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.