Wednesday, April 24, 2013

TFS 2012 Web Access Can’t load your extension


In Team Foundation Server 2012 you can develop extensions to the web interface, there extensions are javascripts (JQuery) that can be easily installed from the TFS Web Access Control Panel.
For information about the scripts and how to make a package and manifest se Serkan's Blog
After creating a package and trying to run my scripts I go a error message:

Module ‘mymodule’ cannot be loaded. This may be due to lost connectivity or an incomplete or corrupted download of the file. Try refreshing your browser or clearing your browser cache to retrieve the file again.

By turning on Web Access Script Debug Mode I found that a script called mymodule.debug.js is mandatory by using Fiddler (Be sure to include a .debug script if you plan to ship your extension or your extension will fail if debug is turned on)

OK so the .debug file was missing, adding that file (An empty one in my case solved the problem) – So the message was telling the truth… the file is not found

So I turned off Web Access Script Debug Mode and looked at Fiddler again, OK here is the solution: My script file was not minified and not called .min.js hence the file was not found.

By renaming the .js file to .min.js the file was loaded and all works as expected.

TFS Web Access expects the extension script to be named your.module.min.js regardless of what files that are in your zipped package.