-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
es6-shim.min.js (v0.34.1) in SharePoint - Uncaught Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch. #399
Comments
Can you provide a reproducible test case, ideally on a jsfiddle? Does that error come with any sort of stack trace? What happens if you include the non-minified version? |
All it takes to reproduce this issue, is to include the MicrosoftAjax 3.5 js (debug version) before ES6 shims. I've reproduced it in Chrome in the following jsfiddle (remember to have the browser debug console open before running it): https://jsfiddle.net/p8ysoxts/ (Note: This fiddle is apparently empty, but the mentioned js files have been included as "external resources" in this fiddle. That is all it takes to reproduce the issue.) |
I've also reproduced it with Microsoft Ajax 4.5.2: |
The problem is that Microsoft Ajax enforces validation of parameters on String.prototype.startsWith, so that it throws an exception when it is called with more than one parameter. ES6-shim runs this function with two parameters as a part of a feature check (line 830 in es6-shim.js). This could be fixed by wrapping this line in a try-catch. |
@arntj In general, shims and polyfills need to always be run first, before application code (and language shims should run before engine-level shims). If you include es5-shim and es6-shim before your Ajax lib, does everything work? |
Yes, it does work, but it's a little inconvenient given the current architecure of our website. |
I'll fix this one - my general policy is not to fix errors like this, unless it's easy - and in this case it's easy. Thanks for confirming! |
This fix will be included in the next release. However, I'd recommend updating this Ajax library that's doing the wrong thing with startsWith, as well as loading the es5-shim and es6-shim first, before anything else. |
When 'es6-shim.min.js' is referred in any SharePoint 2013 page,
it shows the following error:
This may be a conflict issue with .NET Ajax controls..
The text was updated successfully, but these errors were encountered: