<div>Hello,<br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-proton protonmail_signature_block-empty">I want to develop a KWin Script using QML and TypeScript. Unfotunately I cannot get it to work, so that it can use the feature intoduced in ES6 standard - modules. To test this with minimal working example I did the following: I created main.qml with the following content:</div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">```</span></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">import QtQuick 2.0<br></span></div></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">import "../code/script.js" as K<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;"><br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">Item {<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">    id: scriptRoot<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">    Component.onCompleted: {<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">        console.log("Starting the script");<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">        K.main();<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">    }<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">}<br></span></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">```</span></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty">Also I have two javascript files: script.js:</div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">```</span></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">import modu from "./mod";<br></span></div></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;"><br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">function main() {<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">  console.log("Hello from main script!");<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">  modu();<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">}<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;"></span><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;"></span></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">```</span></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty">mod.js:</div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">```</span></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">export default function modu() {<br></span></div></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">  console.log("Hello from module!");<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">}<br></span></div><div><span class="font" style="font-family: menlo, consolas, courier new, monospace, sans-serif;">```</span><br></div><div>Unfortunately, I cannot get this setup to work. In KWin logs, I have nothing (No string is printed). However, if I remove the js import from QML, at least the "Starting the script" is printed. <br></div><div><br></div><div>From what I understand, QML Javascript Engine should support modules (and ES7) <a href="https://doc.qt.io/qt-5/qtqml-javascript-hostenvironment.html#common-base" target="_blank" title="https://doc.qt.io/qt-5/qtqml-javascript-hostenvironment.html#common-base" rel="nofollow">according to the documentation</a>:<br></div><blockquote><div>The QML runtime implements the 7th edition of the standard<br></div></blockquote><div><br></div><div>I would like to ask a help from the experts of KWin: is this a KWin scripting limitation? Why no logs are printed at all? What can I do to create a KWin script with ES6 modules?<br></div><div> <br></div><div>Best Regards,<br></div><div>Mikhail Zolotukhin<br></div>