Uncaught SyntaxError: Cannot use import statement outside a module
The javascript error means just what it says, You need to define your script as a module.