Deployer not loading Js

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example:
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.
Hi i have just deployed my password generator from my github repo. It works fine from my local machine but after deploying it on netlify it seems to not load my index.js.

@nhlaka You’re correct that it’s not loading the /index.js file, which means the file isn’t in that location or doesn’t have that name.

You can download your deployment and inspect the files to get an idea of what is happening:

You may see the file in another spot, or with an automatically generated hash as part of the filename.

I’m not sure what you’re using to build the site, but another option you can try is to run the same build command you have configured on Netlify locally, usually that would be something like npm run build, then go into the folder you have set as your Publish directory and run npx serve.

It will start a development server for only the files you’ve output, and it’s a good way to simulate what is occurring when Netlify serves your static files. If the file doesn’t load there, it won’t load on Netlify.