Note that there are some explanatory texts on larger screens.

plurals
  1. PORequire Module is undefined
    text
    copied!<p>I have a module 'C 'that I already require in module 'A'. I can access module 'C' in module 'A'. My new Module 'B' also requires that module. The implementation of 'B' is the same as in 'A', but my new module gets an undefined module back.</p> <p>module B (js/controller/delete.js): </p> <pre><code>define([ 'jquery', 'underscore', 'backbone', 'views/Box/BrowserView' ], function($, _, Backbone, browser){ alert(browser.created); //alert -&gt; can't read created of undefined [...] }); </code></pre> <p>module A (js/mainView.js):</p> <pre><code>define([ 'jquery', 'underscore', 'backbone', 'views/Box/BrowserView', 'jqm', 'socketio' ], function($,_, Backbone, browser){ alert(browser.created) //alerts false (browser is required) }); </code></pre> <p>Module C (js/views/Box/BrowserView.js)</p> <pre><code>define([ 'jquery', 'underscore', 'backbone', 'text!templates/template.html', 'Controller/delete', 'jqm' ], function($,_,Backbone, bvtemp, delete){ var created = false; [...} return{ [...], created : created } </code></pre> <p>Edit: Require-Configuration</p> <pre><code>var require = { paths: { overrides :'overrides', jquery :'libs/jquery/jquery-1.9.1.min', underscore :'libs/underscore/underscore-min', backbone :'libs/backbone/backbone-min', // jqm :'libs/jquery-mobile/jquery.mobile-1.3.0.min', socketio :'libs/socketio/socket.io', webSocket :'websocket/socketConnection', text :'text', templates :'templates' }, shim: { 'overrides' : {deps: ['jquery']}, 'backbone' : {deps: ['underscore', 'jquery'],exports: 'Backbone' }, 'jqm' : {deps: ['jquery'], exports: 'jqm'}, 'underscore' : { exports: '_'}, 'websocket' : {deps:['socketio']}, 'templates' : {deps: ['jqm']} }}; </code></pre> <p><img src="https://i.stack.imgur.com/rO1Ih.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload