IjzerenHein / famous-flex

Animatable layouts, FlexScrollView & widgets for famo.us.
MIT License
279 stars 44 forks source link

v0.3.2 will crash meteor/famono #103

Closed dcsan closed 9 years ago

dcsan commented 9 years ago

when using the master branch in a meteor project, with famono, i get the error below.

TypeError: Cannot call method 'split' of undefined

With the previous tag v0.3.1 I am able to happily get the app to boot.

[[[[[ ~/dev/ref/flowwy-dcsan/app ]]]]]        

=> Started proxy.                             
=> Started MongoDB.                           
   Building the application                  \
Ensure dependencies...

/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:245
                        throw(ex);
                              ^
TypeError: Cannot call method 'split' of undefined
  at Object.exports.parse (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/parse-stack.js:18:26)
  at Object.exception (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/buildmessage.js:478:28)
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/compiler.js:778:20
  at Array.forEach (native)
  at Function._.each._.forEach (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
  at compileUnibuild (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/compiler.js:338:5)
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/compiler.js:136:26
  at Array.forEach (native)
  at Function._.each._.forEach (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
  at Object.compiler.compile (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/compiler.js:132:5)
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/bundler.js:2090:24
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/buildmessage.js:264:13
  at [object Object]._.extend.withValue (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14)
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/buildmessage.js:257:29
  at [object Object]._.extend.withValue (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14)
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/buildmessage.js:255:18
  at [object Object]._.extend.withValue (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14)
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/buildmessage.js:246:23
  at [object Object]._.extend.withValue (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/fiber-helpers.js:115:14)
  at Object.capture (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/buildmessage.js:245:19)
  at Object.exports.bundle (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/bundler.js:2040:31)
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/run-app.js:554:24
  at time (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/profile.js:231:28)
  at Function.run (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/profile.js:377:12)
  at bundleApp (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/run-app.js:544:34)
  at [object Object]._.extend._runOnce (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/run-app.js:591:35)
  at [object Object]._.extend._fiber (/Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/run-app.js:821:28)
  at /Users/dc/.meteor/packages/meteor-tool/.1.1.3.ylpo7g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/run-app.js:402:12
dcsan commented 9 years ago

I created a branch here to demo this https://github.com/dcsan/flowwy/tree/failing-flex to run it:

git clone git@github.com:dcsan/flowwy.git
cd flowwy
git checkout failing-flex
cd app
meteor
dcsan commented 9 years ago

this error is fairly cryptic, but did something around a version name or package description file... where code is expecting a string ... ?

TypeError: Cannot call method 'split' of undefined
Object.exports.parse
dcsan commented 9 years ago

to be clear: v0.3.1 is OK

checking the diff

https://github.com/IjzerenHein/famous-flex/compare/v0.3.1...v0.3.2

IjzerenHein commented 9 years ago

Are you using a certain file from dist/?

dcsan commented 9 years ago

no, from src

the famono project allows us to refer to your component directly like this:

  "flex": {
    "git": "https://github.com/IjzerenHein/famous-flex.git",
    "root": "src",
  }
IjzerenHein commented 9 years ago

Well in that case I'm really curious what's causing the build to break. Some new classes and changes were added, but nothing special. Perhaps you can use a binary search to pinpoint the commit that's causing the problem?

dcsan commented 9 years ago

OK it seems this commit here is the problem:

https://github.com/IjzerenHein/famous-flex/commit/aa4649e494d9fa6238f4ae2f9d22d322f5079d1e

IjzerenHein commented 9 years ago

Do you think it could be this line? :/

* @copyright Gloey Apps, 2014/2015
IjzerenHein commented 9 years ago

I'm not sure what Meteor and Famono do, but the rest is just plain vanilla Javascript and Famo.us.

dcsan commented 9 years ago

thanks for the tip, I'll try to look into it.

FYI famono is a type of module loader allowing you to use AMD and other package formats with meteor. Unfortunately when it has problems they are super cryptic internals stuff :astonished: https://github.com/raix/Meteor-famono

dcsan commented 9 years ago

OK so going thru the file line-by-line this is what causes the crash:

var LayoutController = require('./LayoutController');

not sure what is special about that require as it sits in a block with some others...

IjzerenHein commented 9 years ago

Ah I see. I think that line causes a circular reference.

IjzerenHein commented 9 years ago

If you can have a look at why that causes famono to bork, then I'll have a look at how I can avoid that reference.

dcsan commented 9 years ago

thanks for all your help! perhaps we'll get some input from famono author too.

flex is an amazing package and in fact famous is pretty unusable without it. They should make this part of famous core and forget the other internal janky scrollviews!

IjzerenHein commented 9 years ago

Hey, I've removed the circular reference. Let me know whether this fixes the issue.

dcsan commented 9 years ago

yes! this fixed it. thanks very much!

IjzerenHein commented 9 years ago

Awesome, glad that solves it!