lit / lit-element

LEGACY REPO. This repository is for maintenance of the legacy LitElement library. The LitElement base class is now part of the Lit library, which is developed in the lit monorepo.
https://lit-element.polymer-project.org
BSD 3-Clause "New" or "Revised" License
4.49k stars 318 forks source link

Error throw when accessing queryAssignedNodes getter #1122

Closed ErikGrimes closed 3 years ago

ErikGrimes commented 3 years ago

Description

An error is throw when accessing the getter created by queryAssignedNodes with a filter targeting a slot containing nodes that are not elements.

Repository

https://github.com/ErikGrimes/lit-query-assigned-nodes-issue

Steps to Reproduce

Example:

  1. Clone the repo
  2. npm i
  3. npm run storybook
  4. Navigate to "AssignedNodes" -> "Simple"
  5. Open the devtools console
  6. Click boom

Expected Results

No error is throw

Actual Results

Error is thrown

Chrome

decorators.ts:470 Uncaught TypeError: Illegal invocation
    at decorators.ts:470
    at Array.filter (<anonymous>)
    at HTMLElement.get [as slotted] (decorators.ts:466)
    at HTMLElement.__goBoom (AssignedNodes.ts:20)
    at EventPart.handleEvent (parts.ts:532)
    at HTMLButtonElement.EventPart.__boundHandleEvent (parts.ts:490)

Firefox

Uncaught TypeError: 'webkitMatchesSelector' called on an object that does not implement interface Element.

Safari 14

TypeError: Can only call Element.webkitMatchesSelector on instances of Element

Browsers Affected

Versions

sorvell commented 3 years ago

This was fixed via #1092 and will be picked up in the next release which we can prioritize.

slavoroi commented 3 years ago

It was merged in October 2020 while the latest version came out in August 2020, which version fixes it?