I have js files which I am using arrow function like the following:
$(document).ready(() => {});
And I am using System.Web.Optimization for bundling and minification in an MVC web application.
When I run my application it shows me the following error:
(9,20-21): run-time error js1195: expected expression: )
So, my question is there any way to configure my app to solve this issue?
.ready(() => {});is ambiguous JavaScript (is the callback returning an empty object-literal or is it a no-op braced function?). If this is not the cause of the error then please post your *actual JavaScript.System.Web.Optimizationonly supports older ES3 (and maybe ES5?) language features considering that System.Web.Optimization was released in 2013 and hasn't been updated since 2014. I'd be wary of using any library or dependency for JavaScript that's more than a couple of years old. You should consider usingwebpackor Rollup instead. But anyway, jQuery is obsolete - it's been obsolete since IE11 came out in October 2013, imo.System.Web.Optimization.