Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. BindingError: emval::as has unknown type j
Qt 6.12 LTS is out! See what's new in the release blog

BindingError: emval::as has unknown type j

Scheduled Pinned Locked Moved Solved Qt for WebAssembly
3 Posts 2 Posters 307 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.
  • M Offline
    M Offline
    Matthew Daskilewicz
    wrote on last edited by
    #1

    I get this error in my browser when the .wasm file is loading, causing it to fail to load.

    (Qt 6.9.3 + emsdk 3.1.70 + qmake)

    Through lots of trial and error, I figured out that it's happening when using emscripten::val, or maybe EM_JS, in a .cpp file that is located in a subfolder (relative to the .pro file). Moving the file up to the main directory yields a wasm file that works normally.

    Has anyone seen this and have any more details on what's causing it and what is a better fix than moving the file? My .pro file is pretty basic and I don't see any reason the location of the file should matter.

    1 Reply Last reply
    0
    • Nils SjobergN Offline
      Nils SjobergN Offline
      Nils Sjoberg
      wrote on last edited by
      #2

      Try an unoptimized build first (without optimizations) to verify a code folding/LTO issue, and if so, update emsdk to a newer version; if you don't feel like messing with it, moving the file is the quick fix.

      "What's up, Doc?"

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Matthew Daskilewicz
        wrote last edited by
        #3

        I did a debug build and got a more helpful stacktrace. It turns out that the problem was due to using QDateTime::fromString to initialize a static variable. It was erroring on using QLocale(). I simply moved the initialization to later in the program startup and now it works. Evidentially the file location wasn't actually relevant but must have had some incidental effect on how things got compiled that caused things to initialize in a different order.

        1 Reply Last reply
        0
        • M Matthew Daskilewicz has marked this topic as solved

        • Login

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