Bootstrap - Uncaught TypeError Cannot read property fn of undefined

0 votes

I am using jquery, backbonejs, underscorejs, and bootstrap for my project and I sometimes get this error in chrome.

Uncaught TypeError: Cannot read property 'fn' of undefined

My shim is like this in my main.js:

require.config({
paths: {
    jquery: 'libs/jquery/jquery',
    underscore: 'libs/underscore/underscore',
    backbone: 'libs/backbone/backbone',
    backboneeventbinder: 'libs/backbone.eventbinder.min',
    bootstrap: 'libs/bootstrap',
    jquerytablesorter: 'libs/tablesorter/jquery.tablesorter',
    tablesorter: 'libs/tablesorter/tables',
    ajaxupload: 'libs/ajax-upload',
    templates: '../templates'
},
shim: {
    'backbone': {
        deps: ['underscore', 'jquery'],
        exports: 'Backbone'
    },
    'underscore': {
        exports: '_'
    },
}
});
 require(['app', ], function(App) {
  App.initialize();
});

I inserted  .noConflict() for jquery, underscorejs and backbonejs.
My app.js:

// Filename: app.js
define(['jquery', 'underscore', 'backbone', 'backboneeventbinder', 'bootstrap', 'ajaxupload', 'router', // Request router.js
], function($, _, Backbone, Bootstrap, Backboneeventbinder, Ajaxupload, Router) {
    $.noConflict();
    _.noConflict();
    Backbone.noConflict();
    var initialize = function() {
            Router.initialize();
        };
    return {
        initialize: initialize
    };
});

Can someone help me with this?

May 10, 2022 in JQuery by Kichu
• 19,050 points
4,583 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In JQuery

0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,880 points
14,322 views
0 votes
0 answers

Datatables: Cannot read property 'mData' of undefined

I am having trouble with data tables, ...READ MORE

May 12, 2022 in JQuery by Kichu
• 19,050 points
4,174 views
0 votes
1 answer

How to make Bootstrap popover Appear/Disappear on hover instead of click?

Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,880 points
2,990 views
0 votes
1 answer

Twitter Bootstrap: How to see the state of a toggle button?

Hii @kartik, You can see what classes the ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,880 points
1,439 views
0 votes
1 answer

jQuery fix for "Uncaught TypeError: $ is not a function" error

We can fix this error by using jQuery() . ...READ MORE

answered Jun 1, 2022 in JQuery by Edureka
• 13,670 points
5,042 views
0 votes
1 answer

Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

Hello @kartik, Looks like your buttons are not ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,880 points
7,961 views
0 votes
1 answer

How can I use wow.js and animate.css without affecting SEO?

there are two animation classes in MDBs ...READ MORE

answered Feb 22, 2022 in Others by narikkadan
• 63,420 points
2,159 views
0 votes
0 answers

Bootstrap : TypeError: $(...).modal is not a function

When I call  bootstrap modal from jquery ...READ MORE

May 1, 2022 in Other DevOps Questions by Kichu
• 19,050 points
2,603 views
0 votes
1 answer

Bootstrap throws Uncaught Error: Bootstrap's JavaScript requires jQuery

Try this Change the order of files it ...READ MORE

answered Jun 10, 2022 in JQuery by gaurav
• 23,260 points
402 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP