@@ -150,6 +150,7 @@ import {
150150 QSlotParent ,
151151 QStyle ,
152152 QStylesAllSelector ,
153+ qwikInspectorAttr ,
153154} from '../shared/utils/markers' ;
154155import { isHtmlElement } from '../shared/utils/types' ;
155156import { VNodeDataChar } from '../shared/vnode-data-types' ;
@@ -1829,9 +1830,49 @@ function materializeFromVNodeData(
18291830 if ( isNumber ( peek ( ) ) ) {
18301831 // Element counts get encoded as numbers.
18311832 while ( ! isElement ( child ) ) {
1833+ const previousChild = child ;
18321834 child = fastNextSibling ( child ) ;
18331835 if ( ! child ) {
1834- throw qError ( QError . materializeVNodeDataError , [ vData , peek ( ) , nextToConsumeIdx ] ) ;
1836+ let childDescription : string | null = null ;
1837+ let childDescriptionFile : string | null = null ;
1838+ if ( isDev ) {
1839+ const getChildDescription = ( ) => {
1840+ if ( previousChild && isElement ( previousChild ) ) {
1841+ return previousChild . outerHTML ;
1842+ } else if ( previousChild && isText ( previousChild ) ) {
1843+ return previousChild . nodeValue ;
1844+ } else {
1845+ return previousChild ?. nodeName || null ;
1846+ }
1847+ } ;
1848+
1849+ const getChildDescriptionFile = ( ) => {
1850+ let previousChildWithFileLocation = previousChild ;
1851+ while ( ! childDescriptionFile && previousChildWithFileLocation ) {
1852+ if (
1853+ isElement ( previousChildWithFileLocation ) &&
1854+ previousChildWithFileLocation . hasAttribute ( qwikInspectorAttr )
1855+ ) {
1856+ return previousChildWithFileLocation . getAttribute ( qwikInspectorAttr ) ;
1857+ }
1858+ previousChildWithFileLocation =
1859+ previousChildWithFileLocation . parentNode as Node | null ;
1860+ }
1861+ return null ;
1862+ } ;
1863+
1864+ childDescription = getChildDescription ( ) ;
1865+ childDescriptionFile = getChildDescriptionFile ( ) ;
1866+ } else {
1867+ childDescription = previousChild ?. nodeName || null ;
1868+ }
1869+ throw qError ( QError . materializeVNodeDataError , [
1870+ childDescription ,
1871+ childDescriptionFile ,
1872+ vData ,
1873+ peek ( ) ,
1874+ nextToConsumeIdx ,
1875+ ] ) ;
18351876 }
18361877 }
18371878 // We pretend that style element's don't exist as they can get moved out.
0 commit comments