Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backbone failed to load underscore dependency #818

Closed
madevelopers opened this issue Dec 26, 2011 · 2 comments
Closed

backbone failed to load underscore dependency #818

madevelopers opened this issue Dec 26, 2011 · 2 comments

Comments

@madevelopers
Copy link

I'm not so sure about this but this quite solves my problem, loading backbone without getting errors.

I found it at line 35 of backbone source that states like this:
if (!_ && (typeof require !== 'undefined')) _ = require('underscore')._;

This code produced this error on the console:
_ is undefined
[Break On This Error] _.extend(Backbone.Model.prototype, Backbone.Events, {

I tried removing '.' and it solves the problem:
if (!
&& (typeof require !== 'undefined')) _ = require('underscore');

Not sure if this works 100% though but that gets rid of the error.

@tbranyen
Copy link
Collaborator

This sounds reasonable. I always require underscore with var _ = require("underscore"); so perhaps its just outdated.

@jashkenas
Copy link
Owner

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants