export
is used for
JavaScript modules[
^], not regular scripts.
If you want to load your script as a module, you need to use
type="module"
, not
type="text/javascript"
. You'll need to use Javascript to attach your event handler -
onclick
won't be able to find the export.
If you want to use a regular script file, remove the
export
keywords from your file.