Why I’m getting Uncaught SyntaxError: import declarations may only appear at top level of a module on custom.js:1 error in my browser console? Have I miss something from documentation?
On the top of custom.js I’m trying to import funcs and const from cookie this way:
import { setCookie, getCookie, deleteCookie } from "js/utils/cookie";
My files, folders structure:
– assets
*|-- js
**|— custom.js
**|— utils
***|— cookie
****|-- index.js
I’m importing my custom.js in HTML this way:
{{ $js := resources.Get "js/custom.js" | js.Build }}
<script src="{{ $js | absURL }}"></script>