Hi Webflow Community,
I’ve been encountering a critical error flagged by a code scan in some boilerplate JavaScript code provided by Webflow. This code is part of the standard JavaScript file used in Webflow projects.
Specifically, the error arises from a discrepancy in the number of parameters passed to the updateHistory
function compared to the number of parameters expected by the function.
Here’s a snippet of the code in question:
function validateScroll(evt) {
// Other code...
updateHistory(hash, evt); // This line passes two parameters to updateHistory
// Other code...
}
function updateHistory(hash) {
// Code for updateHistory function
}
As you can see, the updateHistory
function expects only one parameter, but validateScroll
is passing two parameters to it. This discrepancy is causing a critical error in the code scan.
I’m hesitant to modify the code directly since it’s part of the Webflow boilerplate provided for projects. Can anyone provide insights into why this discrepancy exists and whether it’s expected behavior within Webflow’s framework?
Has anyone else encountered a similar issue with the boilerplate code provided by Webflow? Any guidance or recommendations on how to address this error would be greatly appreciated.
Thank you in advance for your help and insights!
Mitch DiPangrazio