-
-
Notifications
You must be signed in to change notification settings - Fork 10
dynamic imports never resolve, iff you import anything from @nodegui/nodegui in the script doing the importing #34
Comments
update: this seems to be a more general problem with Promises. if you setTimeout, everything works normal. however, creating a loop such as for(let i = 0; i < 5; i ++) {
console.log('waiting 1 second');
await new Promise(res => setTimeout(res, 1000));
} causes the execution to only return to the resolution of the promise once ive moved to another virtual desktop. (3/4 finger scroll over to a fullscreen app, for example) This leads me to believe that execution of promise |
Update: After a lot of tinkering, I've isolated that the execution of my current workaround to this (which is terrible for performance), is to have an infinite loop that calls function updateLoop() {
win.update();
win.repaint();
setTimeout(updateLoop, 100);
}
updateLoop(); Edit: turns out one needs both a repaint, and an update call to fully allow Promises to resolve. updated workaround code. |
Yep this looks like a bug. |
as i must import Each install i The setup seems to be extremely finicky, so I've also included my test file.
|
nodegui version |
Resolved Promises ESM | CJS |
---|---|---|
0.34.0 | 0 | 0 |
0.33.3 | 0 | |
0.33.0 | 0 | |
0.32.0 | 0 | |
0.31.0 | 0 | |
0.30.3 | 0 | |
0.30.0 | * | |
0.29.0 | * | |
0.28.1 | 0 | |
0.27.0 | 0 | |
0.26.0 | 0 | |
0.25.0 | 0 | 0 |
0.24.0 | 0 | 0 |
0.23.1 | 0 | 0 |
0.23.0 | 0 | 0 |
0.22.0 | 0 | 0 |
0.21.0 | 0 | 0 |
0.15.5 | 0 | 0 |
0.15.4 | 0 | 0 |
0.15.3 | 0 | 0 |
0.15.2 | ** | ** |
0.15.1 | ** | ** |
0.15.0-alpha-4 | ** | ** |
0.15.0-alpha | ** | ** |
0.13.4 | - | 5 |
0.12.1 | - | 5 |
0.6.5 | - | 5 |
* came back with an error about not being able to find the binding. '../../../build/Release/nodegui_core.node'
** came back with an error about my QT setup
Blanks are untested; Dashes are ERR_REQUIRE_ESM
(assuming an old enough version of node that import syntax wasn't yet mature)
Hope this info is helpful!
This is issue is solved in master branch of qode. |
Version information:
reproduction steps:
"type": "module"
test.js
imported.js
qode test.js
And you will get no output. However, if you remove line 1 from
test.js
, suddenly everything works as intended. Swapping the order also is seemingly irrelevant, the error persists whether i try to do the dynamic load first or not. Even when attempting to use top level await to force the dynamic import to happen before the static import.The text was updated successfully, but these errors were encountered: