jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.68k stars 2.4k forks source link

JQM 1.5 does not finish loading with RequireJS #8603

Open byamla opened 6 years ago

byamla commented 6 years ago

When using jQuery Mobile 1.5 in conjunction with RequireJS, none of the define() calls except for the very first ever resolve, so the $.mobile namespace and others are never populated. This seems to be the case with files generated by the download builder and built locally with Grunt.

I couldn't figure out a JSBin example since it doesn't seem to serve up the latest 1.5, but my test page using RequireJS and files built locally looks like this:

<html>
  <head>
    <script src="require.js"></script>
    <script>
      require.config({
        paths: {
          'jquery': 'jquery-3.2.0',
          'jquerymobile': 'jquery.mobile'
        }
      });
      require(['jquery'], function ($) {
       console.log('required jquery, version ' + $().jquery);
        require(['jquerymobile'], function (jqm) {
          console.log(typeof $.mobile); //undefined
          console.log(typeof jqm); //undefined
        });
      });
    </script>
  </head>
</html>

The example page from http://demos.jquerymobile.com/1.5.0-alpha.1/backbone-requirejs/ is also failing to load anything: http://demos.jquerymobile.com/1.5.0-alpha.1/backbone-requirejs/backbone-require.html

pistolero38 commented 4 years ago

Same issue...