My webapp has a little algo to swap images on mouseover. Behaves as expected on localhost, both when run at command line and when run as a container.
However, once deployed to Heroku, the algo fails -- it fails to correctly identify the name of the replacement image.
The naming convention is as follows, img-1, img-2, etc. and the algo locates the digit (using regex) and replaces with a randomly generated integer.
Again, it all works fine except on Heroku. Behavior suggests that the algo is failing in the regex area or in the random # generator.
These are the js functions used:
replace(/-[0-9]/,"-"+ Math.floor(Math.random() * 2))
The question, then, is there a reason why these functions would fail on Heroku?
I did run freeze requirements.txt before deploying, results as follows:
click==8.0.1 Flask==0.12 importlib-metadata==4.2.0 itsdangerous==2.0.1 Jinja2==3.0.1 joblib==1.0.1 MarkupSafe==2.0.1 nltk==3.6.2 regex==2021.4.4 tqdm==4.61.0 typing-extensions==220.127.116.11 Werkzeug==2.0.1 zipp==3.4.1