Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.12.0, Qt Creator 4.12.1
-
None
Description
When launching a Qt for WebAssembly application, the main html document is loaded and the error message TypeError: NetworkError when attempting to fetch resource. appears. Nothing more happens
The reason is that emrun quits quickly after the initial html page was loaded. Then, the web server it spawned, shuts down before any further wasm-app related data can be fetched by the browser.
It seems that the behavioral change comes with the upgrade of the Emscripten SDK from 1.38.x to 1.39.x. (That upgrade is required by Qt 5.15 https://doc-snapshots.qt.io/qt5-5.15/wasm.html#install-emscripten). Adding the --serve_after_close commandline parameter to the emrun call fixes the issue, and restores the behavior of Emscripten SDK from 1.38.x, where the web server keeps running, and is only stopped when emrun is shut down by Qt Creator.
Apparently, we are lucky that emrun of Emscripten <= 1.38.x also accepts --serve_after_close and behaves like how we need.