SharePoint Designer | JavaScript changes causing SPD to hang

Problem:
Recently I started to notice that SharePoint Designer has been behaving strangely.

  • When we click save on a JS file it goes on an eternal quest to try and save it
  • The simple opening of an .aspx file that contains javascript functions will take minutes and fail with "The server could not complete your request. For more specific information, click the Details button."

  • After it gives up, the error is displayed: "The server unexpectedly closed the connection."
  • After this (and if you have pending changes) the Designer will prompt to save the file to an alternate location, but not before throwing yet another error: "Could not find a Web server at 'SiteUrl'. Please check to make sure that the Web server name is valid and your proxy settings are set correctly. If you are sure that everything is correct, the Web server may be temporarily out of service."

Solution:

It seems that some file contents sort of get blocked by an internal validation and after correcting these changes, the file will save instantaneously without any issues.

So, this seemingly complex infrastructure issue, turned out to be, in fact, the inability of SPD to deal with the additional space between "function" and its parenthesis!

To fix it, you can find and replace spaces before the parenthesis,

"function (" by "function("

and after the parenthesis,

") {" by "){"

After ensuring that all my script was replaced with these changes, opening, editing and saving files (either .js files or files with js content) became instantaneous.


Related threads:

Comments

  1. To fix it, you can find and replace spaces before the parenthesis,


    I can't find where to modify the file, thank you for your kind help

    ReplyDelete

Post a Comment

Popular posts from this blog

Mobile development opportunities

Breaking down document locking in SharePoint

Working around X-Frame-Options for iframes