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";
git clone --single-branch -b hugo-forum-topic-34963 https://github.com/jmooring/hugo-testing hugo-forum-topic-34963
cd hugo-forum-topic-34963
hugo server
Tested with current versions of Chrome and Firefox.
Thank you! I knew that there is something missing. Before the last refactoring, my code was like the solution, but for some reason, I have replaced this.