Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72864

Can't import a JavaScript module stored in resources

    XMLWordPrintable

Details

    Description

      If a JavaScript module loaded from the file system (/Users/mitch/foo.mjs) tries to import a module stored in the resource system, it fails:

      import {boop} from "qrc:/blah/blah.mjs"
      
      Unable to resolve import reference boop
      

      The use case is allowing users to provide their own scripts to the application (e.g. via application arguments) that are run at startup. These scripts should be able to use some built-in (embedded via qrc) convenience scripts provided by the application.

      The attached minimal application can be used to reproduce this, though I don't get any errors with it as I do with my actual application; it just silently fails.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes