QML Local Directory Imports will be undefined after an uncertain amount of time
-
The program we develop can open/handle different projects, these projects are loaded via a
Loader {}The loaded QML project files access other project specific QMLs with locally imported directories e.g.
import "devices" as DevicesWhere devices is a folder relative to the QML file that uses the import.
This kind of import works for weeks(the program is running 24/7 at a customer) and the code can access the QML files inside the import e.g. Devices.Lan etc...
However sometimes after a long time for some reason the Devices import will be undefined and all other local folder imports as well.These local folders only have qmldir file in them if there are Singleton QML files e.g.
singleton Lan 1.0 Lan.qmlThe projects and their QMLs are not included during build
Qt 6.7.3, mingw 11.20, Windows 11Have anyone experienced this?
Some AI suggestion for this problem was (I couldn't find anything about this problem):- Creating proper qmldir files for each folder
- Build the program with
QML_DISABLE_DISK_CACHE=1flag - Add every folder path to qml import paths
I haven't tried the above suggestions yet as I haven't been able to reproduce the problem locally.
But just in case someone has some insights/ideas I wanted to post here, any kind of discussion might help.