rotundasoftware / parcelify

Add css to your npm modules consumed with browserify.
MIT License
251 stars 20 forks source link

mappedParcel.calcSortedDependencies error when view property is unset in package.json #4

Closed jimthedev closed 10 years ago

jimthedev commented 10 years ago

Hello there,

First off, thank you for building this package. I'm really excited to learn more about what the concept of parcels will mean for development. My gut instinct is that this will be super useful as we focus more and more on web components.

One issue I ran into when doing a little demo for myself was that if you do not set a view property in your parent package.json then you get this error:

parcelify/index.js:210
        mappedParcel.calcSortedDependencies();
                     ^
TypeError: Object #<Package> has no method 'calcSortedDependencies'
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/index.js:210:16
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/node_modules/async/lib/async.js:551:21
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/node_modules/async/lib/async.js:227:13
    at iterate (/Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/node_modules/async/lib/async.js:134:13)
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/node_modules/async/lib/async.js:145:25
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/node_modules/async/lib/async.js:229:17
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/node_modules/async/lib/async.js:556:34
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/node_modules/async/lib/async.js:119:25
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/node_modules/async/lib/async.js:24:16
    at /Users/jimcummins/Documents/vm/vagrant-test/parcelify-test/node_modules/parcelify/index.js:188:5

I wasn't able to find anything about what this view property means although I see you have it set in the page1, page2, directories inside of tests. Since view.html doesn't actually exist, I'm curious what this is used for and why not having it set would break the bundling process.

Again, thanks for this. Great idea.

dgbeck commented 10 years ago

Fixed in 0.6.4, just published.. thanks very much for reporting this issue.. one of those things that could have gone a long time under the radar. Long story short, the view key not needed for parcelify base use case but has to be in there for a project that was re-factored out of this one.

jimthedev commented 10 years ago

@dgbeck Fantastic. Thanks for fixing it so quickly. Look forward to seeing where this project goes.