Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roles is not work with meteor 0.9.1.1 #55

Closed
zakirarrayiq opened this issue Sep 12, 2014 · 20 comments
Closed

Roles is not work with meteor 0.9.1.1 #55

zakirarrayiq opened this issue Sep 12, 2014 · 20 comments

Comments

@zakirarrayiq
Copy link

I create a simple application with

meteor create test-roles
cd test-roles
meteor add alanning:roles
meteor

When I access the web page I get in the console

WARNING: Roles template helpers not registered. Handlebars or UI package not found

What do I need to initialize Meteor.ui?

@Sivli-Embir
Copy link

@alanning Your likely going to just love this but both Handlebars and UI are depreciated. See https://github.com/meteor/meteor/blob/devel/History.md. That said I am not having this problem, not sure why its not working for you @zimme but UI should an alias to Blaze. Possibly load order?

@alanning
Copy link
Contributor

@zakirarrayiq, which version of meteor are you running?

In app directory, run:

$ cat .meteor/release

@zakirarrayiq
Copy link
Author

METEOR@0.9.1.1

@alanning
Copy link
Contributor

@zakirarrayiq, can you check which version of 'roles' is getting pulled in please?

$ meteor list

@alanning
Copy link
Contributor

@zakirarrayiq, the error message you posted is from an older version of roles so it seems roles version v1.2.13 (for Meteor 0.9.1+) is not getting pulled in for some reason. Not sure why, maybe a glitch in the package hosting servers? These steps work for me:

kaia2:~/tmp$ meteor create foo6
foo6: created.

To run your new app:
   cd foo6
   meteor
kaia2:~/tmp$ cd foo6
kaia2:~/tmp/foo6$ meteor add alanning:roles
  added accounts-base at version 1.0.1
  added service-configuration at version 1.0.1
  added alanning:roles at version 1.2.13
  added localstorage at version 1.0.0

alanning:roles: Role-based authorization
kaia2:~/tmp/foo6$ meteor

@CMToups, thanks for the update. I think we're ok with the deprecation as the 0.9+ versions explicitly check for Blaze stuff first (as much as we're able... grrr).

  if (api.versionsFrom) {
    api.versionsFrom('METEOR@0.9.1');
    api.use(['blaze@2.0.0'], 'client', {weak: true});
  } else if(uiExists()) {
    // This is needed due to Meteor Issue #1358
    //   https://github.com/meteor/meteor/issues/1358
    //
    // In meteor < 0.9, the 'weak' flag doesn't work with packages 
    // that aren't in meteor's internal cache (ie. non-core packages)
    api.use(['ui'], 'client', {weak: true});
  } else {
    api.use(['handlebars'], 'client', {weak: true});
  }

Source: https://github.com/alanning/meteor-roles/blob/meteor-0.9.1/roles/package.js#L13-L25

@zakirarrayiq
Copy link
Author

@alanning You are right I am pulling old code. I am behind a proxy and it gives an error first and then defaults to another package server. Here is output

Refreshing package metadata. This may take a moment.
Error connecting to package server: DDP connection timed out
Warning: could not connect to package server
added accounts-base at version 1.0.1
added service-configuration at version 1.0.1
added alanning:roles at version 1.2.12
added localstorage at version 1.0.0

@alanning
Copy link
Contributor

You can manually get it to work by pulling down the meteor-0.9.1 branch contents into your packages directory.

You may also be able to add "ui" to your .meteor/packages file before "alanning:roles" but it depends on how the Meteor 0.9.1.1 release handles old package names.

@zakirarrayiq
Copy link
Author

Thanks for your help. I will wait couple of days to see whether package servers gets updated with your latest versions.

@pnunn
Copy link

pnunn commented Sep 22, 2014

Hi alanning, having some issues upgrading an app to 0.9 and am stuck at the moment on adding roles.

I've mrt migrate-app with out error now (after removing a bunch of pre 0.9 packages from smart.json, including roles), but then tried to do meteor add alanning:roles and I get

Refreshing package metadata. This may take a moment.
Figuring out the best package versions to use. This may take a moment.
Could not resolve the specified constraints for this project:
Error: unknown package: roles

.meteor/releases show METEOR@0.9.2.2. meteor list shows the same error as the add command did.

Any ideas?

OK, found it, had to meteor remove cmather:iron-router, then added iron:core etc and then could load roles. Now to see what else I've broken in the process :)

@alanning
Copy link
Contributor

Looks like we'll need to release another version just for Meteor 0.9.2.

I'll publish a new release today and let you know.

Not sure why the 0.9.1 version is not compatible with 0.9.2 but the good news is that this won't be a problem after 0.9.3 lands as Meteor will allow support for multiple versions of packages.

Sent from my phone

On Sep 21, 2014, at 10:47 PM, Peter Nunn notifications@github.com wrote:

Hi alanning, having some issues upgrading an app to 0.9 and am stuck at the moment on adding roles.

I've mrt migrate-app with out error now (after removing a bunch of pre 0.9 packages from smart.json, including roles), but then tried to do meteor add alanning:roles and I get

Refreshing package metadata. This may take a moment.
Figuring out the best package versions to use. This may take a moment.
Could not resolve the specified constraints for this project:
Error: unknown package: roles

.meteor/releases show METEOR@0.9.2.2. meteor list shows the same error as the add command did.

Any ideas?


Reply to this email directly or view it on GitHub.

@zda
Copy link

zda commented Sep 23, 2014

Don't know if you've already published the new version yet, or if I should just hold tight, but FWIW I'm having the same issue (WARNING: Roles template helpers not registered. Handlebars or UI package not found) on Meteor 0.9.2.2.

@alanning
Copy link
Contributor

@pnunn , it sounds like the issue was an older version of iron router?

@zda, could you publish a small reproduction of this issue please? I'm having a hard time seeing that Warning show up.

@zda
Copy link

zda commented Sep 23, 2014

@alanning
Copy link
Contributor

@zda, Thanks for the repro. Running meteor list results in:

alanning:roles         1.2.12* Role-based authorization

 * New versions of these packages are available! Run 'meteor update' to update.

Running meteor update does nothing... but removing and re-adding fixes the issue by pulling in roles version 1.2.13:

meteor remove alanning:roles
meteor add alanning:roles

@Sivli-Embir
Copy link

Just an FYI after reading this: I have noted that meteor update and meteor update alanning:roles does not seem to work. An easy trick I have found is just editing the .meteor/packages file like such alanning:roles@=1.2.13

@CaptainChainsaw
Copy link

Looks like this is still an issue. I'm getting it on Meteor v1.2.0.1. I've tried removing and adding the package but that didn't work. I've also installed the patch to fix the "Exception in template helper: ReferenceError: Match is not defined " issue.

alanning:roles 1.2.13+ Authorization package for Meteor

Anyone else still getting this issue? Any idea how to fix this?

@alanning
Copy link
Contributor

Hi @CaptainChainsaw,

I just tried creating a new Meteor 1.2.0.1 app and adding roles and it seems to work. I don't see any errors in the console when testing with latest Chrome desktop. Could you try the following steps and see if your results match mine, please?

kaia2:~$ cd tmp
kaia2:~/tmp$ meteor create foo3
Created a new Meteor app in 'foo3'.

To run your new app:
  cd foo3
  meteor

If you are new to Meteor, try some of the learning resources here:
  https://www.meteor.com/learn

kaia2:~/tmp$ cd foo3
kaia2:~/tmp/foo3$ meteor add alanning:roles

Changes to your project's package version selections:

accounts-base          added, version 1.2.1
alanning:roles         added, version 1.2.13
ddp-rate-limiter       added, version 1.0.0
localstorage           added, version 1.0.5
rate-limit             added, version 1.0.0
service-configuration  added, version 1.0.5


alanning:roles: Role-based authorization

kaia2:~/tmp/foo3$ meteor
[[[[[ ~/tmp/foo3 ]]]]]

=> Started proxy.
=> Started MongoDB.
=> Started your app.

=> App running at: http://localhost:3000/
I20150928-13:28:54.066(-4)? ** You've set up some data subscriptions with Meteor.publish(), but
I20150928-13:28:54.067(-4)? ** you still have autopublish turned on. Because autopublish is still
I20150928-13:28:54.068(-4)? ** on, your Meteor.publish() calls won't have much effect. All data
I20150928-13:28:54.068(-4)? ** will still be sent to all clients.
I20150928-13:28:54.071(-4)? **
I20150928-13:28:54.071(-4)? ** Turn off autopublish by removing the autopublish package:
I20150928-13:28:54.071(-4)? **
I20150928-13:28:54.071(-4)? **   $ meteor remove autopublish
I20150928-13:28:54.072(-4)? **
I20150928-13:28:54.072(-4)? ** .. and make sure you have Meteor.publish() and Meteor.subscribe() calls
I20150928-13:28:54.072(-4)? ** for each collection that you want clients to see.
I20150928-13:28:54.072(-4)?
^C
kaia2:~/tmp/foo3$ meteor --version
Meteor 1.2.0.1

@CaptainChainsaw
Copy link

Hey,

challett released a new patch that sorted this:

https://github.com/challett/meteor-roles/tree/challett-patch-4

Cheers :)

@alanning
Copy link
Contributor

Cool! Thanks for the pointer.

@CaptainChainsaw
Copy link

You're welcome :)

@alanning alanning closed this as completed Oct 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants