Daniel Marino
15 October 2024
Fixing Imports for JavaScript Modules Ignoring qmldir Preferences in Applications Using Qt QML

It can be difficult to manage module imports across JavaScript and QML resources, particularly when hot reloading is used. When JavaScript functions that import other modules are exposed by QML modules, this problem becomes noticeable because these imports occasionally disregard the qmldir directive to prioritize file system paths. The prefer declaration is respected by QML imports, but it is frequently not respected by imports within JavaScript resources.