marko: Top-level "if" statement in marko template yields unhelpful error
Bug Report
Marko Version: 4.5.6
Details
I tried to create a component like
<if(input.flash)>
<div class=`alert ${input.flash.type}`>
${input.flash.message}
</div>
</if>
without wrapping it in a div.
Expected Behavior
An error like ERROR at filename.marko:1 : Marko directives must have an enclosing tag.
Actual Behavior
Uncaught TypeError: Cannot read property '___markoDetached' of null
Your Environment
- Environment name and version: Chrome Version 61.0.3163.100 (Official Build) (64-bit), Node 8.6.0
- Operating System and version: MacOS
Steps to Reproduce
- create a component with
<if>as the top-level tag - compile (should happen successfully)
- attempt to run in browser
Stack Trace
Uncaught TypeError: Cannot read property '___markoDetached' of null
at morphComponent (VM28552 index.js:154)
at morphChildren (VM28552 index.js:223)
at morphComponent (VM28552 index.js:124)
at morphChildren (VM28552 index.js:248)
at morphdom (VM28552 index.js:517)
at VM28553 Component.js:475
at Object.batchUpdate [as ___batchUpdate] (VM28550 update-manager.js:63)
at Component.___rerender (VM28553 Component.js:458)
at initComponent (VM28556 init-components-browser.js:103)
at VM28556 init-components-browser.js:261
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (6 by maintainers)
Commits related to this issue
- Resolve issue #914 — committed to DylanPiercey/marko by DylanPiercey 7 years ago
- Issue #914 & #920 fix (#927) * Resolve issue #920. * Resolve issue #914 * Improve test. — committed to marko-js/marko by DylanPiercey 7 years ago
Yeah I’ve been totally unable to reproduce this in a toy project. Maybe I’ll try making a “minimal” version of my existing app, where I’m hitting the problem.