-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
[Vapor]: A compilation error occurs when an element cannot be used as a direct child #14392
Copy link
Copy link
Closed
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: vaporrelated to vapor moderelated to vapor mode
Description
Vue version
3.6.0-beta.5
Link to minimal reproduction
Steps to reproduce
opening the link prompts an error.
What is expected?
correctly render {{ msg }}!
What is actually happening?
Console prompt error: Cannot read properties of null (reading 'firstChild')
System Info
System:
OS: Windows 11 10.0.26100
CPU: (16) x64 Intel(R) Core(TM) Ultra 7 255H
Memory: 16.59 GB / 31.43 GB
Binaries:
Node: 22.18.0 - D:\Document\nodejs\node.EXE
npm: 10.9.3 - D:\Document\nodejs\npm.CMD
pnpm: 10.28.2 - D:\Document\nodejs\pnpm.CMD
Browsers:
Chrome: 144.0.7559.110
Edge: Chromium (140.0.3485.54)Any additional comments?
After investigation, it was found that the problem occurred here
Please guide me on how to make the modifications. I am more than happy to provide Pr.
core/packages/compiler-vapor/src/transforms/transformElement.ts
Lines 393 to 404 in 3019448
if ( context.parent && context.parent.node.type === NodeTypes.ELEMENT && !isValidHTMLNesting(context.parent.node.tag, tag) ) { context.reference() context.dynamic.template = context.pushTemplate(template) context.dynamic.flags |= DynamicFlag.INSERT | DynamicFlag.NON_TEMPLATE } else { context.template += template } }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🔨 p3-minor-bugPriority 3: this fixes a bug, but is an edge case that only affects very specific usage.Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.scope: vaporrelated to vapor moderelated to vapor mode