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. Trouble using Asyncify

Trouble using Asyncify

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
2 Posts 2 Posters 510 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.
  • I Offline
    I Offline
    iSchraeder
    wrote on last edited by
    #1

    Hello, I am trying to create a project using Qt for Webassembly, and in trying to learn how to make calls to JavaScript libraries, I started from an example I found online which is the following snippet of code:

    EM_ASYNC_JS(emscripten::EM_VAL, fetch_json, (const char *url), {
      url = UTF8ToString(url);
    
      let response = await fetch(url);
    
      let json = await response.json();
    
      return Emval.toHandle(json);
    });
    

    Calling this function in a project compiles fine, but yields the following result, suggesting to me that the error is in the JavaScript itself.
    b7f635c9-a3e2-4532-99d9-c45ffa4e5111-image.png

    What does it mean that Asyncify is undefined? How may I best make calls like this from Qt?
    Thank you

    1 Reply Last reply
    0
    • lorn.potterL Offline
      lorn.potterL Offline
      lorn.potter
      wrote on last edited by
      #2

      Did you configure Qt with -device-option QT_EMSCRIPTEN_ASYNCIFY=1 ?

      Freelance Software Engineer, Platform Maintainer QtWebAssembly, Maintainer QtSensors
      Author, Hands-On Mobile and Embedded Development with Qt 5 http://bit.ly/HandsOnMobileEmbedded

      1 Reply Last reply
      0

      • Login

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