Visual Studio 2015 RC + RequireJS + jQuery

787 views Asked by At

I'm using Visual Studio 2015RC + Cordova CLI 5.1.1 + TypeScript + RequireJS + jQuery .

I'd like to change the location of my jquery.js file from the scripts folder to scripts/lib. I added a requirejs.config and changed the jQuery location.

requirejs.config({ baseUrl: 'scripts/lib', paths: { jquery: 'jquery' } });

Unfortunately, when I debug using Ripple I get the following error. Exception occurred Message: Exception: Script error for: jquery http://requirejs.org/docs/errors.html#scripterror enter image description here

I'm not sure if this is a problem with RequireJS and jQuery or VS2015RC + Cordova.

1

There are 1 answers

2
basarat On BEST ANSWER

I'm not sure if this is a problem with RequireJS and jQuery or VS2015RC + Cordova.

The error is that jquery isn't resolving to the jquery.js file (an HTTP 404 error). Check the HTTP Get request made by the browser. It will be something like http://yourapp/scripts/lib/jquery.js. Make this GET call yourself (open the link in your browser. And based on that fix the config to the correct path to jquery.js file.