Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8440177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:12:57+00:00 2026-06-10T08:12:57+00:00

I have a module defined as follows: define( [‘backbone’, ‘View/Sidebar’, ‘View/ControlBar’], function() { …

  • 0

I have a module defined as follows:

define(
    ['backbone', 'View/Sidebar', 'View/ControlBar'],
    function() {
        ...
    }
);

In that module there is a method called loadView, which assigns a variable as follows:

loadView: function(name, bootstrap_function, into) {
    var _class  = require('View/'+name);
    ...
}

So, we can see that both View/Sidebar and View/ControlBar are being loaded by the define call (first arg). When I use require('Sidebar'), I get no errors, yet if I use require('ControlBar') I do get the notorious:

Error: Module name "View/ControlBar" has not been loaded yet for context: _

(http://requirejs.org/docs/errors.html#notloaded)

I have re-written, copied and pasted, verified that it is loaded in Firebug and so on but cannot for the life of me work out why I am getting this error 100% of the time.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:12:59+00:00Added an answer on June 10, 2026 at 8:12 am

    I think this has something to do with how the arguments are called for require. I have found that the following throws an error

    define(
        ['mymodule1', 'mymodule2'],
        function(mod1, mod2) {
            ...
            var x = require('mymodule2');
            ...
        }
    );
    

    Whereas the following does not:

    define(
        ['mymodule1', 'mymodule2'],
        function() {
            ...
            var x = require('mymodule2');
            ...
        }
    );
    

    The difference is whether or not the loaded modules are declared as arguments to the function or not. At least this is the way that it seems to me, it does not, however, make much sense…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have defined a Matrix module as follows: module Matrix = struct type 'a
I have defined a module in a file mod.ml as follows: module Area =
in my self-defined module I have this method which will query the db and
We have a multi-module maven project that uses a profile that defines a buildnumber-maven-plugin
I have module application. When I run it, the main window of that app
I have module that implements custom content type via NodeAPI hooks ( hook_insert ,
I have defined 2 signature and 4 modules as follows, and it works fine:
I have defined a function called is_logged_in? in a user defined library stored in
I have a WCF service defined as follows: Imports System.ServiceModel Imports System.ServiceModel.Web <ServiceContract()> Public
I have a module that conflicts with a built-in module. For example, a myapp.email

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.