ES6 Modules: Undefined onclick function after import
08:25 16 Jun 2017

I am testing ES6 Modules and want to let the user access some imported functions using onclick:

test.html:




    
    Module Test


    
    


test.js:

export function hello() {console.log("hello");}

When I click the button, the developer console says: ReferenceError: hello is not defined. How can I import functions from modules so that they are available as onclick functions?

I am using Firefox 54.0 with dom.moduleScripts.enabled set to true.

javascript ecmascript-6 es6-modules