-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Description
Vue version
3.5.10
Link to minimal reproduction
Steps to reproduce
Create a SFC with this content.
<template>
<table>
<tr></tr>
</table>
</template>
Vite will issue a warning:
warning: <tr> cannot be child of <table>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.
This warning is factually incorrect. The relevant spec says that a <table>
may contain:
In this order: optionally a caption element, followed by zero or more colgroup elements, followed optionally by a thead element, followed by either zero or more tbody elements or one or more tr elements, followed optionally by a tfoot element, optionally intermixed with one or more script-supporting elements.
This is because htmlNesting.ts does not list tr
as a valid child of table
, 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:
warning: <tr> cannot be child of <table>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.
System Info
+-- @vitejs/plugin-vue-jsx@3.1.0
+-- @vitejs/plugin-vue@5.0.4
+-- @vue/tsconfig@0.4.0
+-- vite@5.4.8
+-- vue-tsc@2.1.6
`-- vue@3.5.10