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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:02:01+00:00 2026-06-09T16:02:01+00:00

I have the following Backbone router definition in CoffeeScript: // appointments_router.js.coffee define [app, appointment],

  • 0

I have the following Backbone router definition in CoffeeScript:

// appointments_router.js.coffee
define ["app", "appointment"], (App) ->
  class Snip.Routers.AppointmentsRouter extends Backbone.Router
    initialize: (options) ->
      @appointments = new Snip.Collections.AppointmentsCollection()
      @appointments.reset options.appointments

Here is the “appointment” module on which it depends:

// appointment.js.coffee
define ["app", "relational"], (App) ->
  class Snip.Models.Appointment extends Backbone.RelationalModel
    paramRoot: "appointment"

    defaults:
      time_block_type_code: "APPOINTMENT"
      start_time: null
      start_time_time: null
      start_time_ymd: null
      stylist: {}
      client: {}
      notes: ''

And finally, here is my application.js.coffee:

require
  paths:
    underscore: "lodash.min"
    appointment: "backbone/models/appointment"
    appointmentsRouter: "backbone/routers/appointments_router"
    relational: "backbone-relational"
  shim:
    "underscore":
      exports: "_"
    "backbone":
      deps: ["underscore"]
      exports: "Backbone"
    "relational":
      deps: ["backbone"]

requirejs ["appointmentsRouter"], (AppointmentsRouter) ->
  window.router = new Snip.Routers.AppointmentsRouter({appointments: []})
  Backbone.history.start()

When I load the page, I get Uncaught TypeError: undefined is not a function on backbone.js, line 1019.

If I omit the “relational” shim, I instead get Uncaught TypeError: Cannot set property 'Relational' of undefined in backbone-relational.js. The “undefined” it’s talking about is Backbone. So if I omit the “relational” shim, backbone-relational.js still gets loaded, but it doesn’t know about Backbone.

How do I fix this?

  • 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-09T16:02:02+00:00Added an answer on June 9, 2026 at 4:02 pm

    Turns out I need to require jQuery.

      shim:
        "underscore":
          exports: "_"
        "backbone":
          deps: ["underscore", "jquery"]
          exports: "Backbone"
        "relational":
          deps: ["backbone"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following (extremely simple) module definition, in CoffeeScript: # backbone/routers/appointments_router.js.coffee define [app,
Say I have the following Backbone Router: class App.Routers.ThingsRouter extends Backbone.Router initialize: -> new
I have the following in my coffeescript/backbone app. The problem is it's running console.log
I have following piece of code from my Backbone project: App.Controllers.Test = Backbone.Router.extend({ routes:
I have the following code in my Backbone app, Is there a way to
I have the following class that extends Backbone.View, I want all my backbone views
I have a backbone app with a view structure that looks like the following
I have the following method on a backbone view defined in coffeescript: saveObservation: =>
I have the following backbone.js controller: App.Controllers.PlanMembers = Backbone.Controller.extend({ routes: { message/:messageType: sendMessage, :
I have the following Backbone (in coffeescript) view where i pass an array and

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.