-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Incorrect vite warning regarding nesting tr directly in table element #12088
Comments
const table = document.createElement('table');
table.innerHTML = '<tr></tr>';
console.log(table.innerHTML); |
https://html.spec.whatwg.org/multipage/tables.html#the-tr-element |
I’d suggest making the check more flexible, as it’s not very comprehensive at the moment. |
I don't think this is showing what you think it is showing. This is a serialized DOM. In HTML, |
The directly generated |
At a minimum the warning shouldn't claim that this is due to a spec. It seems this is constraint introduced by the implementation details of hydration. It could say something like this.
Personally, I'm not using SSR at all, so then I would know it's perfectly safe to ignore this warning. |
Yes, the warning should be corrected. Perhaps we can try adding some transformations to similar behaviors so that |
I see the same thing. Fix the warning or provide a work around? |
I'm seeing my stdout absolutely brim-filled with this warning and its accompanying template print out in both dev and build environments, to a point that it swallows and obscures any legitimate warnings. Could this warning be predicated by SSR actually being used? Or could we disable this warning in any way? (except writing a custom vite logger to filter it out) I see that this issue is labeled as an edge-case, my vote is that it is not. |
Vue version
3.5.10
Link to minimal reproduction
https://play.vuejs.org/#eNp9kDELwjAQhf9KuVnqoJMUQcVBBxV1zFLrWatpEpKLFqT/3SSlrYN0CS/vexfe5QMLpeKXRZhBQlgqnhLOmYiihNILb6S/6Hkydkcg4xY51Y/ACMhkUtyKPH4YKdyLHx9nkMlSFRz1XlEhhWEwiwLxLOVcvrfBI21x1PrZHbPnH/9hKu8xOGg0qF/IoGOU6hypwevTDiunO1jKq+UuPQCPaCS3vmMTW1pxdbV/cqHtplRSUyHys1lXhMK0S/miPlmHPAP3rauB1fu6k3ga5pioof4CfnKCSA==
Steps to reproduce
Create a SFC with this content.
Vite will issue a warning:
This warning is factually incorrect. The relevant spec says that a
<table>
may contain:This is because htmlNesting.ts does not list
tr
as a valid child oftable
, despite the spec allowing it.What is expected?
I expect no warning to be produced.
What is actually happening?
A warning is produced from vite:
System Info
The text was updated successfully, but these errors were encountered: