yogiben / meteor-admin

A complete admin dashboard solution
https://atmospherejs.com/yogiben/admin
GNU General Public License v3.0
827 stars 263 forks source link

Tabular.Table - Tabular.Table options must specify collection - Roles Collection #216

Open gazzer82 opened 9 years ago

gazzer82 commented 9 years ago

I have enabled the Roles collection to be shown in meteor-admin as discussed in a separate issue, however for some reason showing roles and using collection-hooks, even with nothing configured for it cause the following error:

W20150623-15:17:33.102(-7)? (STDERR)          
W20150623-15:17:33.102(-7)? (STDERR) /Users/garethjeanne/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150623-15:17:33.102(-7)? (STDERR)                        throw(ex);
W20150623-15:17:33.102(-7)? (STDERR)                              ^
W20150623-15:17:33.148(-7)? (STDERR) Error: Tabular.Table options must specify collection
W20150623-15:17:33.149(-7)? (STDERR)     at new Tabular.Table (packages/aldeed:tabular/common.js:20:1)
W20150623-15:17:33.149(-7)? (STDERR)     at packages/yogiben:admin/lib/both/startup.coffee:100:27
W20150623-15:17:33.149(-7)? (STDERR)     at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
W20150623-15:17:33.149(-7)? (STDERR)     at adminCreateTables (packages/yogiben:admin/lib/both/startup.coffee:77:4)
W20150623-15:17:33.149(-7)? (STDERR)     at __coffeescriptShare (packages/yogiben:admin/lib/both/startup.coffee:125:2)
W20150623-15:17:33.149(-7)? (STDERR)     at /Users/garethjeanne/Documents/Programming/htlv2/htl/.meteor/local/build/programs/server/boot.js:229:

Removing either from the equation fixes the problem, but obviously isn't a real solution. Having the users, or any other collection added to meteor-admin doesn't cause any issues?

Thanks

Gareth

maher-samir commented 9 years ago

+1

mpowaga commented 9 years ago

I had similar issue few weeks ago but this is related to aldeed:tabular package. Try to report an issue there.

One thing you can do is to check if collection causing a problem is instanceof Mongo.Collection. It's very likely to be a problem.

maher-samir commented 9 years ago

no it's not

https://github.com/alanning/meteor-roles/blob/42eebc03ab30a5eb2708f460c1fad3e723decabf/roles/roles_common.js#L14

HazemKhaled commented 9 years ago

Try to open .meteor/packeges file and put alanning:roles after aldeed:collection2 not before it

mordrax commented 9 years ago

My package looks like this (with roles after collection2) but still getting the above error while trying to add roles to admin page

meteor-platform accounts-ui accounts-password accounts-google accounts-twitter accounts-github wylio:mandrill mquandalle:jade iron:router aldeed:autoform aldeed:simple-schema aldeed:collection2 ongoworks:security useraccounts:bootstrap differential:event-hooks momentjs:moment raix:push twbs:bootstrap mrt:flash-messages ovcharik:favico matb33:collection-hooks fortawesome:fontawesome okgrow:iron-router-autoscroll summernote:summernote mpowaga:autoform-summernote zimme:iron-router-auth alanning:roles dburles:collection-helpers meteortoys:allthings@1.2.0 djedi:sanitize-html yogiben:admin

maher-samir commented 9 years ago

Put it after

dburles:collection-helpers

We did it today ;)

mordrax commented 9 years ago

tried that and various other ordering, still getting the error, may i see your package list, maybe if i just copied your exact packages and ordering... i'd like to rule this out before looking at code/file ordering?

maher-samir commented 9 years ago

meteor-platform less accounts-password useraccounts:bootstrap zimme:iron-router-active cmather:handlebars-server@0.2.0 dburles:collection-helpers reywood:publish-composite mrt:moment mrt:underscore-string-latest matb33:collection-hooks alanning:roles dburles:factory anti:fake cunneen:mailgun iron:router@1.0.0 yasinuslu:blaze-meta yogiben:admin@1.2.0 aldeed:simple-schema cfs:standard-packages cfs:gridfs cfs:graphicsmagick

How you add the collection to the admin configuration file? type in browser console

Meteor.roles and check if the has a insert,update, etc. Rights just like Meteor.users

maher-samir commented 9 years ago

Also try to switch matb33:collection-hooks And dburles:collection-helpers

mordrax commented 9 years ago

that didn't work either:

meteor-platform accounts-ui accounts-password accounts-google accounts-twitter accounts-github wylio:mandrill mquandalle:jade iron:router aldeed:autoform aldeed:simple-schema aldeed:collection2 ongoworks:security useraccounts:bootstrap differential:event-hooks momentjs:moment raix:push twbs:bootstrap mrt:flash-messages ovcharik:favico fortawesome:fontawesome okgrow:iron-router-autoscroll summernote:summernote mpowaga:autoform-summernote zimme:iron-router-auth dburles:collection-helpers matb33:collection-hooks alanning:roles meteortoys:allthings@1.2.0 djedi:sanitize-html yogiben:admin

however, I moved helpers, hooks and roles to just under collections and that did work...

meteor-platform accounts-ui accounts-password accounts-google accounts-twitter accounts-github wylio:mandrill mquandalle:jade iron:router aldeed:autoform aldeed:simple-schema aldeed:collection2 dburles:collection-helpers matb33:collection-hooks alanning:roles ongoworks:security useraccounts:bootstrap differential:event-hooks momentjs:moment raix:push twbs:bootstrap mrt:flash-messages ovcharik:favico fortawesome:fontawesome okgrow:iron-router-autoscroll summernote:summernote mpowaga:autoform-summernote zimme:iron-router-auth meteortoys:allthings@1.2.0 djedi:sanitize-html yogiben:admin

hopefully, someone fines this obscure ordering helpful. or rather, hopefully, no one else has to go through random permutations to get it compiling.

Is there a more reliable way of debugging the build process to work out dependencies?

maher-samir commented 9 years ago

That's the question

gazzer82 commented 9 years ago

Yup that sorted it for me too, thanks!

brylie commented 9 years ago

I moved matb33:collection-hooks directly below aldeed:collection2 and that resolved the issue:

aldeed:collection2
matb33:collection-hooks

No other changes to ordering were necessary, where before I was getting the following error:

Error: Tabular.Table options must specify collection
     at new Tabular.Table (packages/aldeed:tabular/common.js:20:1)
     at packages/yogiben:admin/lib/both/startup.coffee:100:27
     at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
     at adminCreateTables (packages/yogiben:admin/lib/both/startup.coffee:77:4)
     at __coffeescriptShare (packages/yogiben:admin/lib/both/startup.coffee:178:2)
     at /home/brylie/Code/Apinf/api-umbrella-dashboard/.meteor/local/build/programs/server/boot.js:229:5
brylie commented 9 years ago

After further investigation, the issue seems related to the position of matb33:collection-hooks and comments in the .meteor/packages file.

# This works
matb33:collection-hooks
comments
# This breaks
comments
matb33:collection-hooks

Our project is based on yogiben:meteor-starter, so this issue may reside there.

brylie commented 9 years ago

I have posted an issue describing the load order of the 'comments' and 'collection-hooks' packages in yogiben:meteor-starter that may be the underlying cause of this issue.

Philip-Nunoo commented 8 years ago

+1 anyone facing this issue should look at @mordra suggestion and follow it through. @mpowaga

tmihelcich commented 5 years ago

This looks like an old issue, but I am having trouble with this nearly three years later. No amount of rearranging the packages made this work for me, I went through each of the suggestions and applied what was relevant to my code. I am still receiving this 'options must specify collection' error, which prevents my app from starting. Was there a final fix for this?