Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Trouble using AWS Javascript SDK with QML (Undefined).
Forum Update on Monday, May 27th 2025

Trouble using AWS Javascript SDK with QML (Undefined).

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 556 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
    James Hankins
    wrote on 3 May 2019, 13:45 last edited by
    #1

    I'm attempting to utilize the AWS Javascript SDK in a Qt Quick project. Specifically the AWS Cognito User Pools.

    I'm importing the SDK like this:

    import "aws-sdk.js" as AWS
    ... //Later Calling like this
    var userPool = new AWS.AmazonCognitoIdentity.CognitoUserPool(poolData);
    

    Receiving an error:TypeError: Cannot read property 'CognitoUserPool' of undefined

    I added the aws-sdk.js by using add existing file from Qt Creator and selecting the file which is in the source directory. Is there something else I need to do to enable the use of the SDK?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fcarney
      wrote on 3 May 2019, 14:16 last edited by
      #2

      Does that code assume it is running in a web browser? It may be expecting a DOM to be available as well as other common objects that browsers support. Are you sure that Qt JS is compatible? You may need to go through the AWS code and see if it relies on anything specific to browsers.

      C++ is a perfectly valid school of magic.

      1 Reply Last reply
      1
      • J Offline
        J Offline
        James Hankins
        wrote on 3 May 2019, 14:27 last edited by James Hankins 5 Mar 2019, 14:28
        #3

        It’s quite possible as AWS does have two versions of the JavaScript SDK. One for browsers and 1 for NodeJS. Thanks, I will dig into this.

        1 Reply Last reply
        0

        1/3

        3 May 2019, 13:45

        • Login

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