Hello! I made a very tiny “counter” project using jQuery. All it does is increment the count when the button is clicked. I am using Vite as my bundler and the project works just fine on my local machine.
Please note that I am using Jquery by downloading the compressed code rather than using CDN. I am not allowed to use CDN for this project.
However, when I pushed to Vercel from the github repo, the button stopped working. In fact, the button was also not working when I set up “Github Pages” for it.
Current behavior - button not working. Likely Jquery is not being applied.
Expected behavior - The button works and increments the count.
I have tried the following ways -
Using npm install jquery
Adding and removing type=module from script tags.
Adding a import $ from 'jquery'; in counter.js (it broke deployment)
Please help me resolve the issue. Lots of thanks in advance.