404 error javascript file

I’ve deployed my first website via github. I don’t know why but I got 404 JS error here. The file path was correct as I didn’t put my file into a sub folder.

site : https://visionary-blini-450810.netlify.app/
Github : GitHub - cnkamorn/passenger-counter-app: Basic Counter People Website creating for deploying on netlify

Could you please advise?

@namdangnamdang Sorry I completely misinterpreted your project on my first look.

Your issue just seems to be that you have’t read this portion of the Vite documentation:
https://vitejs.dev/guide/#index-html-and-project-root

Vite wants you to have a type="module" attribute on your <script> element.

Edit:
Also if you’re wondering why the index.js file which is in the root of your repository isn’t available at /index.js for your deployed site, it’s because you aren’t deploying the root of your repository. If you check you’ll find that your Publish directory is set to dist/, which is the folder that your Vite build produces.

Since your <script> element doesn’t have type="module" Vite never processes it, and it never ends up in the dist/ folder.

You can confirm this by running npm run build locally and looking in the dist/ folder.