yogiben / meteor-admin

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

Unable to get meteor-admin to work #77

Open tomcam opened 9 years ago

tomcam commented 9 years ago

When I add this package to my project, the project cannot start due to build errors like these:

W20141211-16:17:22.674(-8)? (STDERR) /Users/tomcampbell/.meteor/packages/meteor-tool/.1.0.36.624o61++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
W20141211-16:17:22.675(-8)? (STDERR) Error: Cannot find module '/Users/tomcampbell/Documents/meteor/foo/.meteor/local/build/programs/server/npm/iron:router/node_modules/body-parser'

Steps to reproduce:

Followed instructions at (https://github.com/yogiben/meteor-admin#getting-started), I think. To recap:

$ meteor create foo
$ cd foo
$ meteor # works
# NOOO..... meteor add iron:router
$ meteor add accounts-base accounts-password
$ meteor # works
$ meteor add bootstrap
$ meteor # works
$ meteor add chrismbeckett:fontawesome4
$ meteor # works
$ cat .meteor/packages
meteor-platform
autopublish
insecure
accounts-base
accounts-password
bootstrap
chrismbeckett:fontawesome4

$ meteor remove autopublish insecure
$ meteor add yogiben:admin 
$ meteor run # THIS is where all the messages spew out during build process

You will note I omitted meteor add iron:router, which I had thought might be the problem. Error messages are the same whether or not I use it.

As you can see I also started meteor after adding each package.

I am using Meteor version 1.0.1

meepeek commented 9 years ago

I have got the same problem.

dcsan commented 9 years ago

you guys have nothing else in your .meteor/packages ?

i wonder if the 1.0.2 meteor release broke something? which version of meteor are you running?

you could also add the .meteor/versions data here in case somehow there's a different set of packages being used.

meepeek commented 9 years ago

I am also using 1.0.1, the error is as following:

.meteor/packages/meteor-tool/.1.0.36.1bpsnai++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173

Is there any workaround that could be done for the time being ?

rwatts3 commented 9 years ago

Just an idea. Delete the local directory and let meteor rebuild it.

yogiben commented 9 years ago

I'm also running the latest version of meteor and the packages.

I'm afraid we can't find a work around without being able to reproduce the error.

meepeek commented 9 years ago

Fresh created project, then meteor add yogiben:admin and I have got this:

Your app is crashing. Here's the latest log.

** You've set up some data subscriptions with Meteor.publish(), but
** you still have autopublish turned on. Because autopublish is still
** on, your Meteor.publish() calls won't have much effect. All data
** will still be sent to all clients.
**
** Turn off autopublish by removing the autopublish package:
**
**   $ meteor remove autopublish
**
** .. and make sure you have Meteor.publish() and Meteor.subscribe() calls
** for each collection that you want clients to see.

/Users/thee/.meteor/packages/meteor-tool/.1.0.37.1ktlc2z++os.osx.x86_64+web.browser+web.cordova/meteor-tool-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
                        throw(ex);
                              ^
ReferenceError: AdminConfig is not defined
    at adminCollectionObject (packages/yogiben:admin/lib/both/utils.coffee:2:5)
    at packages/yogiben:admin/lib/both/startup.coffee:20:32
    at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
    at __coffeescriptShare (packages/yogiben:admin/lib/both/startup.coffee:14:4)
    at /Users/thee/storage/work/test/.meteor/local/build/programs/server/boot.js:182:5
Exited with code: 8
Your application is crashing. Waiting for file change.
Thees-MacBook-Air-4:test thee$ meteor --version
Meteor 1.0.2
Thees-MacBook-Air-4:test thee$ 
mpowaga commented 9 years ago

You need to define AdminConfig object globally both on the server and client side. The absence of this variable should be handled in more gentle way. I will fix it soon.

aspiringpro commented 9 years ago

I'm completely lost!

If I create a new app like meteor create testapp then where do I clone the meteor-starter repo?

dcsan commented 9 years ago

meteor-starter is a standalone repo. you dont need to create an app with that, it is one already, and it should demo the admin.

aspiringpro commented 9 years ago

Demo the admin? It seems to be functioning for me. Do I need to add the meteorite for the admin?

mariorodriguespt commented 9 years ago

This package is a real nightmare. Today I tried to used it production but creating my own admin back office is a lot faster and simple. I got more issues with the subscriptions that frozen the UI and decide to bomb your server with a sub/unsub infinite loop.

dcsan commented 9 years ago

the package works pretty well if you don't have a lot of data. over a few hundred records it will totally lockup. but building your own admin is a huge amount of time/hassle. you could also look at the comet fork which is in atmosphere, that works pretty well for me with large sets of data.

aspiringpro commented 9 years ago

Okay so should I just abandon trying to use this to start my projects? Can't someone just build a functional meteor starter project that showcases the complete power and features of Meteor without being such a drain on system resources. Everytime I start Meteor, my system completely slows down and it takes minutes to open pages. Should I abandon Meteor altogether and just stick with PHP?

aspiringpro commented 9 years ago

Comet looks like the same package. What is the difference?

mariorodriguespt commented 9 years ago

@aspiringpro If it takes minutes to open pages, you're doing something very very wrong. I've been using Meteor in production for the last 9 months and everything smoothly. You also have to pick the right tool to the job and Meteor is not suitable for some scenarios.

@dcsan I've create my own and it's doesn't take that much time as you think. The admin back office is still missing in Meteor because there is a lack of solid foundation. Lots of developers are using simple-schema and auto form, I don't think that these packages are a good decision to use as foundation (in the select tag, I've to declared it inside a property autoform, why? Shouldn't this package decide based on the declared schema?).

All I need is:

If I'm going to use package to delegate this task I expect it to easy to setup, extend and proper documentation. Django is a great example.

As for yogiben:meteor-admin, I don't contribute to projects that use coffeescript, period.

aspiringpro commented 9 years ago

Yeah I was confused about the coffee too. Is that just to make the code cleaner to read?

mariorodriguespt commented 9 years ago

I'm not sure about what I'm going to say:

As far I know, it's was created because ruby developers didn't liked the javascript syntax. So, someone created it and added features. Some people might live very well with it but I don't. It feels like an unnecessary abstraction for me. I don't mind typing {} () and ;

The code generated it isn't easily readable unless you're stupid enough to believe it because you defend coffeescript. It's just a choice and I simply decided to stick with javascript.

dcsan commented 9 years ago

Can't someone just build a functional meteor starter project As for yogiben:meteor-admin, I don't contribute to projects that use coffeescript, period

hey guys, this thread is degenerating a bit into dogma and entitlement. yogiben and others have created a great admin tool here that many people are using, but they don't owe you support. if php is working for you, then no reason to change?

dcsan commented 9 years ago

Comet looks like the same package. What is the difference?

it has datatables implemented, which afaik still loads all the data client side, but it works well enough.

@mpowaga has apparently extended meteor admin with https://github.com/alethes/meteor-pages which should theoretically be a better solution, but i don't know where the code is for that (or if its in a public fork). I don't see anything here: https://github.com/mpowaga/meteor-admin

yogiben commented 9 years ago

The pages was already implemented, although @mpowaga still doesn't believe it's the perfect solution.

dcsan commented 9 years ago

the pages implementation is in master? i did a pull a few days back and meteor-admin still locked up for me. i guess i'll try with an empty DB just to check i'm getting the right code branch...

ghost commented 9 years ago

Same here, running on Ubuntu Linux and get the following:

I20150120-16:20:35.221(0)? ** You've set up some data subscriptions with Meteor.publish(), but
I20150120-16:20:35.225(0)? ** you still have autopublish turned on. Because autopublish is still
I20150120-16:20:35.226(0)? ** on, your Meteor.publish() calls won't have much effect. All data 
I20150120-16:20:35.227(0)? ** will still be sent to all clients.
I20150120-16:20:35.233(0)? **
I20150120-16:20:35.234(0)? ** Turn off autopublish by removing the autopublish package:
I20150120-16:20:35.235(0)? **
I20150120-16:20:35.237(0)? **   $ meteor remove autopublish
I20150120-16:20:35.240(0)? **
I20150120-16:20:35.242(0)? ** .. and make sure you have Meteor.publish() and    Meteor.subscribe() calls
I20150120-16:20:35.243(0)? ** for each collection that you want clients to see.
I20150120-16:20:35.246(0)? 
W20150120-16:20:35.305(0)? (STDERR) 
W20150120-16:20:35.306(0)? (STDERR) /media/user/SuperS/.meteor/packages/meteor-tool/.1.0.38.1rvrg0o++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150120-16:20:35.306(0)? (STDERR)                                             throw(ex);
W20150120-16:20:35.306(0)? (STDERR)                                                   ^
W20150120-16:20:35.381(0)? (STDERR) ReferenceError: AdminConfig is not defined
W20150120-16:20:35.381(0)? (STDERR)     at adminCollectionObject (packages/yogiben:admin/lib/both/utils.coffee:2:5)
W20150120-16:20:35.381(0)? (STDERR)     at packages/yogiben:admin/lib/both/startup.coffee:20:32
W20150120-16:20:35.382(0)? (STDERR)     at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
W20150120-16:20:35.382(0)? (STDERR)     at __coffeescriptShare (packages/yogiben:admin/lib/both/startup.coffee:14:4)
W20150120-16:20:35.382(0)? (STDERR)     at /home/user/Documents/Meteor/test2/.meteor/local/build/programs/server/boot.js:182:5
=> Exited with code: 8

To reproduce: Running Meteor 1.0.2.1 Create an empty Hello World app in Meteor. Add the package $ meteor add yogiben:admin Update the main.js to read:

if (Meteor.isClient) {
    var AdminConfig = {
        collections: {
            Posts: {}
        }
    };
  // counter starts at 0
  Session.setDefault("counter", 0);

 Template.hello.helpers({
 counter: function () {
   return Session.get("counter");
    }
 });

  Template.hello.events({
   'click button': function () {
    // increment the counter when button is clicked
    Session.set("counter", Session.get("counter") + 1);
  }
 }); 
}

if (Meteor.isServer) {
    var AdminConfig = {
        collections: {
            Posts: {}
        }
    };
    Meteor.startup(function () {
    // code to run on server at startup

  });  
}

Bit of a newbie at this so forgive any stupid mistakes etc.

Same here, running on Ubuntu Linux and get the following:

I20150120-16:20:35.221(0)? ** You've set up some data subscriptions with Meteor.publish(), but
I20150120-16:20:35.225(0)? ** you still have autopublish turned on. Because autopublish is still
I20150120-16:20:35.226(0)? ** on, your Meteor.publish() calls won't have much effect. All data 
I20150120-16:20:35.227(0)? ** will still be sent to all clients.
I20150120-16:20:35.233(0)? **
I20150120-16:20:35.234(0)? ** Turn off autopublish by removing the autopublish package:
I20150120-16:20:35.235(0)? **
I20150120-16:20:35.237(0)? **   $ meteor remove autopublish
I20150120-16:20:35.240(0)? **
I20150120-16:20:35.242(0)? ** .. and make sure you have Meteor.publish() and    Meteor.subscribe() calls
I20150120-16:20:35.243(0)? ** for each collection that you want clients to see.
I20150120-16:20:35.246(0)? 
W20150120-16:20:35.305(0)? (STDERR) 
W20150120-16:20:35.306(0)? (STDERR) /media/user/SuperS/.meteor/packages/meteor-tool/.1.0.38.1rvrg0o++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:173
W20150120-16:20:35.306(0)? (STDERR)                                             throw(ex);
W20150120-16:20:35.306(0)? (STDERR)                                                   ^
W20150120-16:20:35.381(0)? (STDERR) ReferenceError: AdminConfig is not defined
W20150120-16:20:35.381(0)? (STDERR)     at adminCollectionObject (packages/yogiben:admin/lib/both/utils.coffee:2:5)
W20150120-16:20:35.381(0)? (STDERR)     at packages/yogiben:admin/lib/both/startup.coffee:20:32
W20150120-16:20:35.382(0)? (STDERR)     at Function._.each._.forEach (packages/underscore/underscore.js:113:1)
W20150120-16:20:35.382(0)? (STDERR)     at __coffeescriptShare (packages/yogiben:admin/lib/both/startup.coffee:14:4)
W20150120-16:20:35.382(0)? (STDERR)     at /home/user/Documents/Meteor/test2/.meteor/local/build/programs/server/boot.js:182:5
=> Exited with code: 8

To reproduce: Create an empty Hello World app in Meteor. Add the package $ meteor add yogiben:admin Update the main.js to read:

if (Meteor.isClient) {
    var AdminConfig = {
        collections: {
            Posts: {}
        }
    };
  // counter starts at 0
  Session.setDefault("counter", 0);

 Template.hello.helpers({
 counter: function () {
   return Session.get("counter");
    }
 });

  Template.hello.events({
   'click button': function () {
    // increment the counter when button is clicked
    Session.set("counter", Session.get("counter") + 1);
  }
 }); 
}

if (Meteor.isServer) {
    var AdminConfig = {
        collections: {
            Posts: {}
        }
    };
    Meteor.startup(function () {
    // code to run on server at startup

  });  
}

Bit of a newbie at this so forgive any stupid mistakes etc.

Update... have got it working by looking at yogiben's sample app at https://github.com/yogiben/meteor-starter

So we have to expose the AdminConfig explicitly - see the updated code excerpt below taken from main.js

if(Meteor.isClient) {
 window.AdminConfig = AdminConfig

  // counter starts at 0
  Session.setDefault("counter", 0);

  Template.hello.helpers({
    counter: function () {
     return Session.get("counter");
    }
  });

  Template.hello.events({
    'click button': function () {
      // increment the counter when button is clicked
      Session.set("counter", Session.get("counter") + 1);
    }
  });
}
if (Meteor.isServer) {
    global.AdminConfig = AdminConfig
    Meteor.startup(function () {
    // code to run on server at startup

  });
 }

Also when defining your collections you have to make them global as well. Created a test collection called Books which works.

var Schemas = {};

Schemas.Book = new SimpleSchema({
    title: {
        type: String,
        label: "Title",
       max: 200
    },
   author: {
       type: String,
       label: "Author"
   },
   copies: {
       type: Number,
       label: "Number of copies",
       min: 0
   },
   lastCheckedOut: {
      type: Date,
      label: "Last date this book was checked out",
      optional: true
  },
  summary: {
      type: String,
      label: "Brief summary",
      optional: true,
      max: 1000
  }
 });

   var Books = new Mongo.Collection("books");

   Books.allow ({
           insert: function (userId, book){
              return true;
       },
       update: function (userId, book){
           return true;
      }
   }
)

Books.attachSchema(Schemas.Book);

global.Books = Books

Make sure to install on the pre-requisites packages or you will get errors.

rwatts3 commented 9 years ago

Adminconfig needs to be available to both the client and server. I've found that following the folder structure of client and server works best when using meteor admin. For instance Ben uses a folder called both to define where both server and client based code should go. If you look at the meteor-starter repository for a good reference on setting up your own meteor - admin.

Let me know if this helps.