net::ERR_ABORTED 404 (Not Found) - and TailwindCSS Follow
I have the following problem.
GET http://localhost:63342/Imc/src/public/js/script.js net::ERR_ABORTED 404 (Not Found).
This error occurs when I'm trying to import a modal in the script file type module as per print. And the index.html file is in SRC and the script.js in PUBLIC.
Please sign in to leave a comment.
The leading slashes in script URL ("/public/js/script.js") tell the browser to resolve URLs from the web server root. But the built-in web server serves files from
http://localhost:63342/<project name>, so no resources can be loaded from
http://localhost:63342- thus the issue. There is unfortunately no way to set it up to use project root as server document root. I can only suggest using URLs relative to current
.htmlfile instead of URLs with leading slashes, or use a different web server to host your apps.
Note that we have added some fixes recently that make (most) of absolute paths work on the built-in web server, see https://youtrack.jetbrains.com/issue/WEB-11949/simplify-built-in-web-server-document-root-configuration#focus=Comments-27-5029164.0-0. But some problems still remain, see https://youtrack.jetbrains.com/issue/WEB-57280/Built-in-web-server-URL-links-in-CSS-dont-work-if-CSS-is-loaded-using-absolute-path-with-leading-slash, for example