This issue has been created
There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-0a7f62a0-ce27-4fa5-9d61-217ce323a5d9 XWIKI-24230 Open

Failed to render macro (reached a theoretically unreachable statement)

 
View issue   ·   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-abe12b33-11fc-41e3-bc7b-07797a9d4aaf Marius Dumitru Florea created this issue on 15/Apr/26 18:03
 
Summary: Failed to render macro (reached a theoretically unreachable statement)
Issue Type: cid:jira-generated-image-avatar-0a7f62a0-ce27-4fa5-9d61-217ce323a5d9 Bug
Affects Versions: 18.2.1
Assignee: Unassigned
Components: BlockNote
Created: 15/Apr/26 18:03
Priority: cid:jira-generated-image-static-major-fd8793a1-381a-4fee-a435-be23c24eb2a5 Major
Reporter: Marius Dumitru Florea
Description:

Create a page with this content:

{{info}}
alfa
{{/info}}

{{html}}
beta
{{/html}}

Edit the page with BlockNote. The information macro call has a rendering error:

Failed to render macro: Reached a theoretically unreachable statement

and there is a corresponding stacktrace in the JavaScript console:

Object { ​unreachable: Object { type: "text", styles: {}, content: "Information" } }
index.ts:30:11
    uy index.ts:30
    convertBlock converter.tsx:329
    convertBlocks converter.tsx:140
    wrapNative prototype.js:1270
    convertBlocks converter.tsx:135
    blocksToReactJSX converter.tsx:79
    CT index.ts:90
    blocksToReactJSX converter.tsx:78
    m utils.tsx:308
    render utils.tsx:349
    React 14
    kze index.js:679
    mount index.js:880
    Gke index.js:6454
    Aze index.js:813
    jie index.js:1034
    render React
    addNodeView defaultBlocks-Caw1U1oV.js:271
    l index.js:3636
    create index.js:1294
    addNode index.js:1944
    updateChildren index.js:1398
    lEe index.js:2060
    updateChildren index.js:1377
    addNode index.js:1946
    updateChildren index.js:1398
    lEe index.js:2060
    updateChildren index.js:1377
    updateInner index.js:1473
    update index.js:1465
    updateNextNode index.js:1901
    updateChildren index.js:1395
    lEe index.js:2060
    updateChildren index.js:1377
    updateInner index.js:1473
    update index.js:1465
    updateStateInner index.js:5453
    updateState index.js:5404
    dispatchTransaction index.js:4951
    dispatch index.js:5779
    transact blocknote.js:2930
    transact blocknote.js:3481
    replaceBlocks blocknote.js:789
    replaceBlocks blocknote.js:3723
    U BlockNoteViewWrapper.tsx:274
    (Async: setTimeout handler)
    U BlockNoteViewWrapper.tsx:264
    e BlockNoteViewWrapper.tsx:314
    React 19
    n scheduler.development.js:45
    (Async: EventHandlerNonNull)
    Rze scheduler.development.js:223
    Rze scheduler.development.js:364
    Rze main.es.js:77014
    $ie index.js:6
    React 3
    <anonymous> main.es.js:103792

The HTML macro call is rendered fine.

 
 

1 comment

 
cid:jira-generated-image-avatar-abe12b33-11fc-41e3-bc7b-07797a9d4aaf Marius Dumitru Florea on 15/Apr/26 18:07
 

This issue has the same root case as XWIKI-23539: UniAst syntax doesn't support DIVs (group syntax) so when a macro outputs a group (XDOM) block, that block is lost and replaced by its contents. This can lead to inline content in the macro output where block-level content is expected, thus causing the client-side rendering error. The HTML macro call doesn't have this problem because it generates a paragraph block which is supported by UniAst (so its text, the inline content, remains inside a paragraph).