jeromegn / Backbone.localStorage

A localStorage adapter for Backbone.js
MIT License
1.9k stars 681 forks source link

Loading Backbone LocalStorage with requirejs returns an error #220

Closed scavassa91 closed 7 years ago

scavassa91 commented 7 years ago

I'm loading BackBone LocalStorage with requirejs and it returns this error

image

I'm thinking that is related with the AMD verification in the beginning of the code, because the object is always undefined.

scavassa91 commented 7 years ago

To fix this problem I've done this.

else if(typeof define === 'function' && define.amd)
    define(['underscore', 'backbone'], factory);
scott-w commented 7 years ago

Hi guys, I've closed this ticket and published v2.0.1 to NPM. Thanks for your patience and to the guys who published fixed outputs to (hopefully) keep people's builds working in the meantime 👍

scavassa91 commented 7 years ago

Hello @scott-w, I've tested the solution but i noticed that underscore is named as backbone and this cause another problem. error Would you like that I make a pull request to fix this issue?

scott-w commented 7 years ago

Hi @scavassa91 - thanks for this, I'll reopen the issue 👍

scott-w commented 7 years ago

@scavassa91 I've sorted this and published a new build to NPM @2.0.2. Thanks for the quick spot!