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. Application exit (ReferenceError: SharedArrayBuffer is not defined)
Forum Updated to NodeBB v4.3 + New Features

Application exit (ReferenceError: SharedArrayBuffer is not defined)

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
2 Posts 2 Posters 1.9k Views 1 Watching
  • 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.
  • C Offline
    C Offline
    CKurdu
    wrote on 11 Sept 2023, 15:23 last edited by CKurdu 9 Nov 2023, 16:46
    #1

    Hello everybody,

    My webassembly based Qt app works expected from Qt Creator but When I deployed the to my http server, it gave me the below error.

    Settings are

    Qt 6.5.2(multi-threadd)
    emscripten version : 3.1.25
    Development Machine OS: Windows 11

    Application exit (ReferenceError: SharedArrayBuffer is not defined)
    

    I think the problem is related to web worker or threads. Some security problems. Not sure.

    from the developer console, it gave this output.

    ReferenceError: SharedArrayBuffer is not defined
        at eval (eval at completeLoadEmscriptenModule (qtloader.js:461:9), <anonymous>:9:8417)
        at completeLoadEmscriptenModule (qtloader.js:462:9)
        at qtloader.js:345:13
    

    When I compile the same project with a single thread, it works as expected from an HTTP server.
    Kind Regards

    You reap what you sow it

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JasonWong
      wrote on 15 Sept 2023, 03:14 last edited by JasonWong
      #2

      You need to modify the http header. If you are using nginx deployment, you need to modify the conf file.

      This header needs to be modified:

      add_header 'Cross-Origin-Embedder-Policy' 'require-corp';
      add_header 'Cross-Origin-Opener-Policy' 'same-origin';
      
      1 Reply Last reply
      1

      1/2

      11 Sept 2023, 15:23

      • Login

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