stenciljs/core

bug: chrome crashes with "Aw, snap" message

Open

#5887 aperta il 5 lug 2024

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)TypeScript (844 fork)auto 404
Bug: ValidatedHas WorkaroundHelp Wanted

Metriche repository

Star
 (13.111 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Prerequisites

Stencil Version

4.19.2

Current Behavior

Chrome crash after toggle between <slot> elements With DevTools open I can reproduce it 100%, but sometimes it happens also without DevTools open but for this case I dont have a reproducible repo.

Repo: https://github.com/danielleroux/chrome-crash

Problem is related to toggle a <slot>

Component A render function

{this.doTheCrash ? (
          <div>
            Desktop
            <slot></slot>
          </div>
        ) : (
          <comp-b>
            Mobile
            <slot></slot>
          </comp-b>

and the Host class with combination of display: none

component B render function

      <Host
        class={{
          show: false,
        }}
      >
        <slot></slot>
      </Host>

CSS:

:host(:not(.show)) {
  display: none;
}

Expected Behavior

Not to crash the chrome instance

System Info

System: macOS
Chrome: Version 126.0.6478.127 (Official Build) (arm64)

Steps to Reproduce

Checkout repo: https://github.com/danielleroux/chrome-crash

  1. npm run start
  2. Open Browser with DevTools
  3. Resize
  4. Click the button (maybe multiple times if not resized correctly)

Code Reproduction URL

https://github.com/danielleroux/chrome-crash

Additional Information

https://github.com/ionic-team/stencil/assets/2144313/fd4157d0-5ca7-4a7d-831f-86a8bd860ba7

Guida contributor