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 9039363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:42:44+00:00 2026-06-16T09:42:44+00:00

I am new to both Backbone and Require JS. I am receiving the following

  • 0

I am new to both Backbone and Require JS.

I am receiving the following error:

Cannot read property View of undefined.

So Backbone is not available, but I cannot see where the problem is. Any help would be much appreciated.

I have the following 3 files:

index.html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <script data-main="boot" src="../libs/require/require.js"></script>
  </head>
  <body>
    <div id="main">Magic!</div>
  </body>
</html>

boot.js:

require.config({
  baseUrl: "../",
  paths: {
      jquery : "libs/jquery/jquery-1.8.3.min",
      underscore : "libs/underscore/underscore-min",
      backbone : "libs/backbone/backbone-min"
  }
});

require( [ "app/views/app" ], function(AppView) {
  var app = new AppView();
});

app.js:

define([
    "jquery",
    "underscore",
    "backbone"
    ], function( $, _, Backbone ) {

    var AppView = Backbone.View.extend({
        el: $( "#main" ),
        initialize: function () {
             this.render();
        },
        render: function() {
            this.el.html("huzzah!");
        }
    });
    return AppView;

});
  • 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-16T09:42:45+00:00Added an answer on June 16, 2026 at 9:42 am

    You’re going to need to shim backbone in order for it to work with requirejs.

    From the RequireJS docs:

    requirejs.config({
        shim: {
            'backbone': {
                //These script dependencies should be loaded before loading
                //backbone.js
                deps: ['underscore', 'jquery'],
                //Once loaded, use the global 'Backbone' as the
                //module value.
                exports: 'Backbone'
            }
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im new to both ruby and rails, but have experience with java, javascript and
I’m a bit new to Backbone.js, but am already impressed by everything it can
Being new to both WPF and MVVM, I'm studying Josh Smith's article on the
I am new to both Jena-TDB and SPARQL, so it might be a silly
I am pretty new to both Dreamweaver and Coldfusion, and I am having a
I am new to both SO and web development in general. Sorry for my
I am new to both EF and Ninject so forgive me if this does
I am new to both Qt and Linux C++ development (although I have many
I'm new on both this site and ruby on rails! I have a common
So I'm new to both Joomla and Expression Engine, and want to know if

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.