JS module export/import does not work
I need help getting what amounts to a straightforward module export/import to work.
I followed docs/notes online for construction a rudimentary module, with the export statement at the top, then in the calling script, I reference the item within the module in the import statement and the "stupid" error appears
Here's the jist:
project.js looks like:
time_utils.js looks like:
The browser throws and error on the
So, what am I missing to make this work? Thanks for any/all substantive contributions!
I followed docs/notes online for construction a rudimentary module, with the export statement at the top, then in the calling script, I reference the item within the module in the import statement and the "stupid" error appears
Uncaught SyntaxError: import declarations may only appear at top level of a moduleHere's the jist:
project.js looks like:
time_utils.js looks like:
The browser throws and error on the
import line in project.js.So, what am I missing to make this work? Thanks for any/all substantive contributions!
