For some reason, a frontend feature I’m working on is working when I run my project locally, but not in the deployed environment.
I opened the two web pages (the application running locally and the deployed application) in Firefox. After spending a huge amount of time debugging the JS execution in the deployed application, I target the source of the problem : this JS expression Array.from(new Array(31).keys())
.
When I eval this expression in the console of the page showing the local app, it returns an array containing all number from 0 to 30.
And when I eval the exact same expression in the console of the page showing the deployed app, it returns an empty array.
So, basically, the Array
class behaves differently in 2 pages of the same web browser.
How can I sort this out?
Is there a way to see which version of Javascript is currently used to execute the source code? Is there a way to specify a version to use, using HTML, JS or, I don’t know, HTTP headers ?
Maybe some code of the deployed application alters the prototype of Array
?