JS Error in the Webflow.js file

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

Hi Mitch, Thanks for bringing this up. Would you mind sharing how you downloaded this specific boiler plate code and the version?

Hi Anshuri,

This on the LTS for Webflow, and I exported the code directly from Webflow.

Thanks,
Mitch