I am currently working on developing a single-page application (SPA) / progressive web app (PWA) using Vue Js.
One challenge I am facing is importing a file of functions from the 'src' folder to the 'public' folder in my project directory.
Here's what I have tried:
In my index.html file located in the public folder:
Initially, when trying to import the functions, I encountered this error:
Uncaught SyntaxError: Cannot use import statement outside a module
. To address this, I added type="module"
, but now I am receiving a new error: GET http://localhost:8080/src/scripts/sc.js net::ERR_ABORTED 404 (Not Found)
.
Does anyone know how I can resolve this issue?