0

I'm new in RequireJs. I'm using Bootstrap 4. I found console error with RequireJs and Bootstrapjs with ajax.

enter image description here

If I inspect element using firebug then I see all files are load correctly.

enter image description here

HTML code

<script data-main="js/signupconfig" src="js/require.js"></script>

signupconfig.js

requirejs(['./main'], function (main) {
    requirejs(['app/signup']);
});

main.js

requirejs.config({
    baseUrl: 'js/lib',
    paths: {
        app: '../app',
        jqueryslim: 'https://code.jquery.com/jquery-3.1.1.slim.min',
        jquerymin: 'https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min',
        tether: 'https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min',
        bootstrapmin: 'bootstrap.min'
    }
});

signup.js

define (['jqueryslim', 'jquerymin', 'tether', 'bootstrapmin'], function (){});

file structure

js app signup.js lib bootstrap.min.js require.js main.js

I don't understand what I missing. I seen stackoverflow has duplicate question already. But I'm thinking difference. If local file isn't working like my code then other local file will not work.

Note: I don't want CDN link solution for bootstrap js.

Community
  • 1
  • 1
Rahul
  • 2,011
  • 3
  • 18
  • 31
  • Possible duplicate of [Twitter Bootstrap js file loaded but not working alongside requirejs](http://stackoverflow.com/questions/20130892/twitter-bootstrap-js-file-loaded-but-not-working-alongside-requirejs) – Louis Feb 19 '17 at 12:43
  • It does not matter whether you want to load from a CDN or not. The answer in that other question has the solution to your problem: you must use a `shim` settings. – Louis Feb 19 '17 at 12:44
  • `CDN` solution isn't working with bootstap 4 because of `tether.min.js`. I'm thinking about the `shim` setting. – Rahul Feb 19 '17 at 12:48

0 Answers0