-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Open
Labels
✨ feature requestNew feature or requestNew feature or request
Description
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
Include a <search>
element in a template
What is expected?
The element is picked up as a native element
What is actually happening?
[Vue warn]: Failed to resolve component: search
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement
System Info
No response
Any additional comments?
<search>
is a new HTML element that provides a search
landmark, rather than requiring role="search"
(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/search). The element is supported in iOS/iPadOS 17, Safari 17 and Firefox 118.
emilsgulbis, lukewarlow, Mister-Hope, felix-berlin, azrdn and 4 more
Metadata
Metadata
Assignees
Labels
✨ feature requestNew feature or requestNew feature or request
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
felix-berlin commentedon Dec 30, 2023
Hey, got the same error on an Vue + Astro project. I tried to solve the warning with
compilerOptions.isCustomElement
, but had no luck. Link to my Astro Issue.daaanny90 commentedon Jan 19, 2024
There is an idea when this will be merged?
Use the search role, rather than the search element
lenaschimmel commentedon Aug 20, 2024
In PR #9249 there is a comment which explains why the PR should not be merged, and I totally agree with that reasoning. I also like the the proposed clean solution.
Anyway, is there any workaround that we can use to suppress the warning until a proper solution is implemented and merged?
mvsde commentedon Oct 15, 2024
@lenaschimmel You can tell Vue to treat the
<search>
tag as a custom element to suppress the warning.I adjusted my Vite configuration like this:
I used an array to define the tags to have the option to add more if necessary.
There are alternative ways if you don’t use Vite:
https://vuejs.org/guide/extras/web-components.html#skipping-component-resolution
<search>
to known HTML elements #13728