This is a migrated thread and some comments may be shown as answers.

Cordova and Requirejs issues

2 Answers 108 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dan
Top achievements
Rank 1
Dan asked on 14 Apr 2016, 01:03 PM

I must be missing something obvious. I am trying to setup a cordova app using requirejs. When deploying to a device none of the libraries load. I assume it has to do with the file system and I am not setting the paths correctly. 

 

requirejs.config({
    baseUrl: '/',
    paths: {
        bootstrap: 'Scripts/lib/bootstrap.min',
    jquery: 'Scripts/lib/jquery.min',
    knockout: 'Scripts/lib/knockout',
    //text: 'bower_components/requirejs-text/text',
    }
});

 

Just a simple require of jquery and "$" is undefined.

requirejs(['jquery'], function ($) {
alert('$: ' + $);
});

 

In the online simulator debugging tells me it can't find the jquery file. MY local native simulator works fine.

 

Any ideas? I know it must be something simple I am over looking.

2 Answers, 1 is accepted

Sort by
0
Dan
Top achievements
Rank 1
answered on 14 Apr 2016, 08:17 PM
I did try this as well....
requirejs.config({
    baseUrl: './',
    paths: {
        bootstrap: 'Scripts/lib/bootstrap.min',
    jquery: 'Scripts/lib/jquery.min',
    knockout: 'Scripts/lib/knockout',
    //text: 'bower_components/requirejs-text/text',
    }
});

 

This shows that requirejs is at least finding the file, as debug isn't throwing a 404. The problem is the require function is always returning undefined.

0
Tsvetina
Telerik team
answered on 19 Apr 2016, 07:48 AM
Hello Dan,

Our system indicates that your team has submitted a support ticket regarding the same issue and a colleague is already working on it. I suggest you continue the conversation there until you find a solution and if you'd like, you can post it here for others to see.

Regards,
Tsvetina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or