Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. WebAssembly - App Restart gives "RuntimeError: abort(Module.arguments has been replaced with plain arguments_"
Forum Updated to NodeBB v4.3 + New Features

WebAssembly - App Restart gives "RuntimeError: abort(Module.arguments has been replaced with plain arguments_"

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
1 Posts 1 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    just_a_developer
    wrote on 24 Feb 2022, 14:07 last edited by just_a_developer
    #1

    Hello,

    I am trying to use the following WebAssembly module configuration :

    restartMode: "RestartOnExit",
    restartType: "RestartModule",
    restartLimit: 10000
    

    I freshly created a new Qt Quick Empty Application using Qt Creator.
    I only added this to main.cpp :

    QObject::connect(&engine, &QQmlApplicationEngine::quit, &QGuiApplication::quit);
    

    this to main.qml :

    Button {
            anchors.centerIn: parent
            text: "Quit App"
            onClicked: {
                Qt.callLater(Qt.quit)
            }
        }
    

    and this to CMakeLists.txt :

    #This comes after the `qt_finalize_executable` call : 
    
    #Update the *.html, to configure `restartMode: "RestartOnExit"`, and `restartType: "RestartModule"1, and restartLimit: 10000`
    FILE(READ ${CMAKE_CURRENT_BINARY_DIR}/WasmRestart.html WASM_RESTART_HTML)
    STRING(REGEX REPLACE "canvasElements" "restartMode: \"RestartOnExit\", restartType: \"RestartModule\", restartLimit: 10000, canvasElements" UPDATED_WASM_RESTART_HTML "${WASM_RESTART_HTML}")
    FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/WasmRestart.html "${UPDATED_WASM_RESTART_HTML}")
    

    When I Build&Run it for WebAssembly,
    the Actual behaviour : after pressing on the "Quit App" button, the application is giving a Runtime Error :

    RuntimeError: abort(Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)) at Error at jsStackTrace (eval at completeLoadEmscriptenModule (http://localhost:30002/qtloader.js:443:14), :1827:19) at stackTrace (eval at completeLoadEmscriptenModule (http://localhost:30002/qtloader.js:443:14), :1844:16) at abort (eval at completeLoadEmscriptenModule (http://localhost:30002/qtloader.js:443:14), :1530:44) at Object.get (eval at completeLoadEmscriptenModule (http://localhost:30002/qtloader.js:443:14), :261:7) at eval (eval at completeLoadEmscriptenModule (http://localhost:30002/qtloader.js:443:14), :256:11) at eval () at completeLoadEmscriptenModule (http://localhost:30002/qtloader.js:443:14) at http://localhost:30002/qtloader.js:332:13
    

    Screenshot 2022-02-24 at 14.46.01.png

    Expected behaviour would be : after pressing on the "Quit App" button, the application should successfully restart.

    Side note : It works with restartType: "ReloadPage", but I would like to avoid having to reload the page.

    Side note 2 : It also works in case if I apply the following modifications on the WasmRestart.js file :

    1. Screenshot 2022-02-24 at 21.27.40.png
    var calledRun;
    
=>
    var calledRun = false;
    
      function findEventTarget(target) {
          target = maybeCStringToJsString(target);
          if (target.length == 0) {
            return null
          }
    
      function exposePublicSymbol(name, value, numArguments) {
          if (Module.hasOwnProperty(name)) {
              if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) {
                  // throwBindingError("Cannot register public name '" + name + "' twice");
    

    But I guess that these modifications could cause some issues...

    1 Reply Last reply
    0

    1/1

    24 Feb 2022, 14:07

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved