Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.7.1
-
None
Description
Hi, I want to preface this by saying that we are not knowledgeable with javascript. We want to use a javascript library that is self contained in single javascript file without any dependencies. So we ended up importing it from qrc like this:
CMakeLists.txt:
qt_add_qml_module( ... QML_FILES dagre.js ... )
main.qml:
import "qrc:/dagre.js" as Dagre
It seems to import this javascript file without parsing errors, but we can't access the module.exports provided by the library, for example we tried code from their example and we get the following error:
var g = new Dagre.graphlib.Graph();
error:
main.qml: TypeError: Cannot read property 'Graph' of undefined
I'm attaching also the dagre.js, where graphlib export seems to happen in dagre.js:80, but we can't access it from qml.
Can you check what we could be doing wrong in this process?