-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
6.10.0 Beta2
-
None
-
macOS Sequoia 15.6 (24G84)
2025 MacBook Air M4
Similar to other bugs already reported, may be the same as: https://bugreports.qt.io/browse/QTBUG-138391
Including a .js file in a module causes the application to fail to load with an error about ambiguity.
warning: qrc:/qt/qml/MyProject/src/qml/PlanetList.qml: "MyProject" is ambiguous. Found in qrc:/qt/qml/MyProject/ and in qrc:/qt/qml/MyProject/
The offender is actually the js file under QML_FILES when adding the module in CMakeLists.txt
qt_add_qml_module(appMyProject URI MyProject VERSION 1.0 QML_FILES Main.qml PlanetList.qml NumberFormatter.js )
In the release build of Qt, the app will run when the .js file is in the root folder, as above. Moving it to another folder causes the error about ambiguity. In the 6.10.0-beta2 version, the app fails to run even with the .js file in the project's root directory.
Disabling policy QTP0004 resolves the failure to start:
# workaround for bug with javascript files
qt_policy(SET QTP0004 OLD)
More information has been posted on the forums: https://forum.qt.io/topic/163000/ambiguous-project-when-using-files-in-subdirectory/2
- duplicates
-
QTBUG-138391 Deep-nested QML module containing *.mjs file can cause ambiguous import
-
- Closed
-