-
Notifications
You must be signed in to change notification settings - Fork 795
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
bug: E2EPage.find()
throws error when using piercing selector targeting a non-existing element
#5113
Closed
3 tasks done
Labels
Bug: Validated
This PR or Issue is verified to be a bug within Stencil
Comments
tanner-reits
added
the
Bug: Validated
This PR or Issue is verified to be a bug within Stencil
label
Nov 30, 2023
@jcfranco Thanks for letting us know! I was able to confirm the regression from v4.7.2. We'll work on getting this resolved ASAP! |
tanner-reits
added a commit
that referenced
this issue
Nov 30, 2023
Fixes a regression caused by the removal of a few `asElement()` calls. Turns out these are necessary for the case where the handle is `null`. To avoid type errors, we cast the returned value to be of type `ElementHandle<Element>` rather than `ElementHandle<Node`. STENCIL-1032: `E2EPage.find()` throws error when using piercing selector targeting a non-existing element Fixes: #5113
tanner-reits
added a commit
that referenced
this issue
Nov 30, 2023
Fixes a regression caused by the removal of a few `asElement()` calls in 91cfa2c. Turns out these are necessary for the case where the handle is `null`. To avoid type errors, we cast the returned value to be of type `ElementHandle<Element>` rather than `ElementHandle<Node`. STENCIL-1032: `E2EPage.find()` throws error when using piercing selector targeting a non-existing element Fixes: #5113
2 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Nov 30, 2023
Fixes a regression caused by the removal of a few `asElement()` calls in 91cfa2c. Turns out these are necessary for the case where the handle is `null`. To avoid type errors, we cast the returned value to be of type `ElementHandle<Element>` rather than `ElementHandle<Node`. STENCIL-1032: `E2EPage.find()` throws error when using piercing selector targeting a non-existing element Fixes: #5113
The fix for this was included as a part of today's v4.8.1 release! |
@tanner-reits Thanks for fixing! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Stencil Version
4.8.0
Current Behavior
Calling
find
with a piercing selector where the target does not exist throws an error instead of returningnull
as the doc states.Expected Behavior
For
find()
to returnnull
for shadow DOM elements that are not found.System Info
Steps to Reproduce
See repro case readme.
Code Reproduction URL
https://github.com/jcfranco/stencil-4.8.0-breaks-piercing-selector-for-non-existent-elements
Additional Information
4.7.2 does not throw an error and works as expected.
The text was updated successfully, but these errors were encountered: