Skip to content

MDL-written pluggable widget (Accordion) makes the module unpackageable: create-module-package crashes in the mpr hasher while every check stays clean #931

Description

@Chendodelangen

Summary

An Accordion written through MDL produces a model that Mendix itself cannot package. mxcli check is clean, Studio Pro's consistency check is clean, mxbuild reports BUILD SUCCEEDED, and mx create-module-package dies:

Exception occurred: Unable to cast object of type 'Newtonsoft.Json.Linq.JValue' to type 'Newtonsoft.Json.Linq.JObject'.
   at Mendix.Modeler.Storage.Mpr.MprProperty.Init(JToken value)          in MprProperty.cs:line 95
   at Mendix.Modeler.Storage.Mpr.MprUnit.get_Contents()                  in MprUnit.cs:line 70
   at Mendix.Modeler.Packages.Identification.MprDocumentHasher.Write(...) in MprDocumentHasher.cs:line 26
   at Mendix.Modeler.Packages.Export.ModulePackageExporter.Export(...)   in ModulePackageExporter.cs:line 77

The lead developer hit this while exporting the module for handover, on a build that every gate had approved. Only the module-package hasher walks this path, so nothing in the normal loop catches it.

Environment: mxcli v0.18.0 (2026-08-14T20:29:13Z), Windows, Mendix 11.12.2, real project (~1450 units, 24 modules).

What breaks, in three stages

1. The stored property tree does not match the widget definition. After a page write containing

PLUGGABLEWIDGET 'com.mendix.widget.web.accordion.Accordion' accordion1 (
  advancedMode: false, collapsible: false, expandBehavior: singleExpanded,
  animate: true, showIcon: right, animateIcon: true
) {
  GROUP group1 (HeaderRenderMode: 'text', HeaderText: 'Odoo Connector',
                HeaderHeading: 'headingThree', Visible: 'true',
                LoadContent: 'always', InitialCollapsedState: 'expanded',
                InitiallyCollapsed: 'false')
}

mx create-module-package refuses with:

- In Page 'SyncState_Overview' (element: Accordion 'accordion1'): The definition of this
  widget has changed. Update this widget by right-clicking it and selecting 'Update widget'.

An accordion authored by Studio Pro in the same module and the same project exports fine, so it is the write, not the widget version.

2. Regenerating the page leaves the bad widget object behind. CREATE OR MODIFY PAGE with the accordion removed from the definition still crashes the hasher with the JValue/JObject cast. The orphaned widget object is what the hasher chokes on, so removing the widget from the page is not enough to recover.

3. The documented repair destroys page content. mx update-widgets normalizes the tree and the export succeeds, but while a malformed accordion is present it strips the entire page body: a five-tab TABCONTAINER, two action buttons and three DataGrid2s were reduced to the accordion alone. Running it only after the page has been rewritten without the accordion keeps the content intact (12 widgets survived) and exports cleanly.

Reproduction (bisect, each round on a copy)

Model state mx create-module-package
baseline after mx update-widgets Export successful
+ page with DataGrid2 + Atlas design properties Export successful
+ page with the MDL-written Accordion ERROR: definition of this widget has changed
+ same page with the Accordion removed (orphan remains) Exception: JValue -> JObject
+ page without Accordion, then mx update-widgets Export successful

DataGrid2 and the Switch widget did not show this; only the Accordion in our case, but the mechanism (writer emits a property tree the widget definition does not accept) is not accordion-specific.

Why this matters more than the average writer gap

A model that passes every check and cannot be packaged is invisible until handover, which is exactly when it costs the most. Two suggestions, in order of value:

  1. mxcli check (or lint) should flag a pluggable widget whose stored property tree does not match the installed widget definition - the same condition Studio Pro reports as "definition of this widget has changed".
  2. A page rewrite should clean up the widget objects it replaces, so a regeneration cannot leave an orphan that breaks packaging.

Related: #891 (ALTER PAGE cannot address widgets inside a pluggable widget; DESCRIBE renders an accordion group as empty), #928 (widget properties silently dropped on write), #548 (CE0463 on engine-routed pluggable widgets, closed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions