My JS function is not defined when I deployed my website

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • 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.

My JS function is not working as I intended it to be, but the website is deployed for me. What are the solutions I can come up with?

My Git Repo: GitHub - DevRomu/Soccer_Score_Counter: I coded this simple counter app with Javascript, HTML, and CSS
The Website: https://neon-salamander-b766dd.netlify.app/

You’re using Vite, you haven’t run your build locally, and if you have then you haven’t noticed that it tells you exactly what the issue is:

Your index.js file, (found by Vite within your index.html file), isn’t being bundled because you haven’t specified an attribute of type="module" on the script element.

This behavior is mentioned in the Getting Started documentation for Vite.

1 Like

Thanks for the help!

1 Like