Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
5.15.1
-
None
Description
In the attached project that should compile and run successfully, the issue happens in logic.js:10 where answerToLife fails to return 42 because Constants is null. The rest of the project is boilerplate to make it compile and run and trigger the bug.
Looking at logic.js:1 you see
.import "constants.js" as Constants
and it's not obvious why Constants would be null.
The actual output is
qml: TempScreen created qml: Answerer created qml: TempScreen destroyed qml: Answerer trying to get answer, but Constants is null so I get qrc:/logic.js:10: TypeError: Cannot read property 'answer' of null
The expected output would for the last line to print
The answer to life is 42
instead.
The apparent reason is that main.qml:13 destroys tempScreen which cleans up Constants.js prematurely, even though var logic in main.qml:5 still relies on it.