Skip to content

Commit ee2f893

Browse files
committed
chore: remove the materialize error from qerror and change description
1 parent fddecc9 commit ee2f893

File tree

2 files changed

+11
-44
lines changed

2 files changed

+11
-44
lines changed

packages/qwik/src/core/client/vnode.ts

+9-42
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ import {
150150
QSlotParent,
151151
QStyle,
152152
QStylesAllSelector,
153-
qwikInspectorAttr,
154153
} from '../shared/utils/markers';
155154
import { isHtmlElement } from '../shared/utils/types';
156155
import { VNodeDataChar } from '../shared/vnode-data-types';
@@ -1832,48 +1831,16 @@ function materializeFromVNodeData(
18321831
while (!isElement(child)) {
18331832
const previousChild = child;
18341833
child = fastNextSibling(child);
1835-
if (!child) {
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;
1834+
assertDefined(
1835+
child,
1836+
`Resuming error: Expected text or element node following:\n`,
1837+
previousChild,
1838+
{
1839+
metadata: vData,
1840+
currentValue: consumeValue(),
1841+
nextIdx: nextToConsumeIdx,
18681842
}
1869-
throw qError(QError.materializeVNodeDataError, [
1870-
childDescription,
1871-
childDescriptionFile,
1872-
vData,
1873-
peek(),
1874-
nextToConsumeIdx,
1875-
]);
1876-
}
1843+
);
18771844
}
18781845
// We pretend that style element's don't exist as they can get moved out.
18791846
while (isQStyleElement(child)) {

packages/qwik/src/core/shared/error/error.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const codeToText = (code: number, ...parts: any[]): string => {
4949
'Unable to find q:container', // 41
5050
"Element must have 'q:container' attribute.", // 42
5151
'Unknown vnode type {{0}}.', // 43
52-
'Materialization error: Expected a text or element after\n{{0}}\nat location {{1}}\n metadata: {{2}},\n value: {{3}},\n next id: {{4}}', // 44
52+
'', // 44 unused
5353
'Cannot coerce a Signal, use `.value` instead', // 45
5454
'useComputedSignal$ QRL {{0}} {{1}} returned a Promise', // 46
5555
'ComputedSignal is read-only', // 47
@@ -119,7 +119,7 @@ export const enum QError {
119119
containerNotFound = 41,
120120
elementWithoutContainer = 42,
121121
invalidVNodeType = 43,
122-
materializeVNodeDataError = 44,
122+
UNUSED_44 = 44,
123123
cannotCoerceSignal = 45,
124124
computedNotSync = 46,
125125
computedReadOnly = 47,

0 commit comments

Comments
 (0)