Cordova and Requirejs issues

3 posts, 0 answers
  1. Dan
    Dan avatar
    2 posts
    Member since:
    May 2015

    Posted 14 Apr Link to this post

    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. Dan
    Dan avatar
    2 posts
    Member since:
    May 2015

    Posted 14 Apr Link to this post

    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.

  3. Tsvetina
    Admin
    Tsvetina avatar
    1874 posts

    Posted 19 Apr Link to this post

    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
Back to Top