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

Calling Meteor.userAsync inside pub throws an error in meteor 3 beta #307

Closed
bratelefant opened this issue Jan 20, 2024 · 5 comments
Closed

Comments

@bratelefant
Copy link

If you call Meteor.userAsync inside a publication you get a Meteor.userId can only be invoked in method calls or publications.

To Reproduce
Steps to reproduce the behavior:

  1. Clone my minimal repo
  2. Start the app via meteor run
  3. Open the browser to call the pub links (from server/main.js), which calls Meteor.userAsync() inside.
  4. See error in the console

Expected behavior
It is expected, that this exceptions is not thrown, since Meteor.userAsync() is called within a publication.

Screenshots

Desktop:

  • OS: macOS Ventura
  • Browser chrome, safari

Smartphone:
n/A

Additional context
You can downgrade to 2.14 via meteor update --release 2.14 and the exception disappears. Also, you can meteor remove matb33:collection-hooks and the exceptions disappears.

Copy link

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously.
Our goal is to provide long-term lifecycles for packages and keep up
with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time.
Therefore, we can't guarantee you issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit
a pull request, too! We will accompany you in the process with reviews and hints
on how to get development set up.

Please also consider sponsoring the maintainers of the package.
If you don't know who is currently maintaining this package, just leave a comment
and we'll let you know.

@denihs
Copy link

denihs commented Feb 23, 2024

This is now fixed on beta.4!

@bratelefant
Copy link
Author

Great, going to test it!

@jankapunkt
Copy link
Member

@bratelefant can this be closed?

@bratelefant
Copy link
Author

Guess yes, didn't come across this issue anymore

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

3 participants