Hi, I’m trying to deploy a website on Netlify but the JS file is not loaded correctly. In fact, the <script>
tag is not even in the website HTML upon inspection while it is there in my github dist
folder. I think it may have something to do with root “/” I used in the path: <script src="/dist/main.js"></script>
. I need to use root because this JS script is accessed in multiple urls so the relative path won’t work. Can someone help me? Thanks.
1 Like
hi @AlienKevin - I don’t see any main.js
being linked to in the head of the html file you deployed.
Can you look at your deployment history and make sure that that build/deploy went through?
If you see any errors, please post your build log here.
Made an account just to say this. I am having the exact same problem.
In my HTML i have:
<script src="/dist/build.js"></script>
The console is giving me net::ERR_ABORTED 404
Important to note that this is not in the top directory. Both the HTML file and js are both in a subdirectory.
@Snacksy, a link to your website would help more and the link to your repo would be the best.