Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.13
Description
I have some JavaScript code in an .mjs module file that is called by C++. The C++ code also registers some types for QML to use:
qmlRegisterUncreatableType<AiComponentData>("Isle", 1, 0, "AiComponentData", "AiComponentData should not be created in QML");
I want to use those types in my .mjs file, just like I would in a .js file:
.import Isle 1.0 as Isle
export function foo() {
print(AiComponentData.Friendly)
}
However, I get an error:
error importing module: "Expected token `;'" "qrc:/script.mjs" "1"
I need to import the module so that I can use the enum that's registered with the AiComponentData class.
Attachments
Issue Links
- is duplicated by
-
QTBUG-71389 Add support for QML module imports in ES Modules
- Open