diff --git a/.changeset/spicy-turtles-travel.md b/.changeset/spicy-turtles-travel.md new file mode 100644 index 0000000000..f93748df5a --- /dev/null +++ b/.changeset/spicy-turtles-travel.md @@ -0,0 +1,5 @@ +--- +"marko": patch +--- + +Improve compatibility of legacy Marko widgets loading a template compiled as esm. diff --git a/packages/marko/src/node_modules/@internal/components-define-widget-legacy/index-browser.js b/packages/marko/src/node_modules/@internal/components-define-widget-legacy/index-browser.js index 6c5ac364b0..4a2648853f 100644 --- a/packages/marko/src/node_modules/@internal/components-define-widget-legacy/index-browser.js +++ b/packages/marko/src/node_modules/@internal/components-define-widget-legacy/index-browser.js @@ -320,7 +320,7 @@ module.exports = function defineWidget(def, renderer) { template = req(template); } - registry.r(template.___typeName, function () { + registry.r((template.default || template).___typeName, function () { return Component; }); }