very strange bug here. If called form the API, require() statements

sometimes return blank objects, but only when required from within
habitrpg-shared - i can require the files directly from the API just
fine. Doesn't help however since habitrpg-shared has dependencies on
itself. @yangit any thoughts?
This commit is contained in:
Tyler Renelle 2013-05-25 19:34:45 +01:00
parent 51a80b6626
commit 002d4f9541
2 changed files with 5 additions and 2 deletions

View file

@ -7,7 +7,8 @@
"coffee-script": "1.6.2",
"lodash": "~1.2.1",
"moment": "~2.0.0",
"relative-date": "~1.1.1"
"relative-date": "~1.1.1",
"habitrpg-shared": "git://github.com/HabitRPG/habitrpg-shared#master"
},
"devDependencies": {
"mocha": "*",

View file

@ -1,10 +1,12 @@
moment = require('moment')
_ = require('lodash')
helpers = require('./helpers.coffee')
items = require('./items.coffee')
{pets, hatchingPotions} = items.items
# Very strange bug where `require(./script/helpers.coffee)` is returning a blank object under certain circumsntances I haven't yet figured out
helpers = require('habitrpg-shared/script/helpers') if _.isEmpty(helpers)
XP = 15
HP = 2
obj = module.exports = {}