Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

Meteor 3: Error: Meteor.userId (DDP._CurrentPublicationInvocation.get()) #314

Open aboire opened 2 weeks ago

aboire commented 2 weeks ago

with the package install it returns DDP._CurrentPublicationInvocation.get() undefined

https://github.com/meteor/meteor/issues/13258#issuecomment-2314923925

https://github.com/Meteor-Community-Packages/meteor-collection-hooks/blob/migrate/3.0/server.js#L30

Meteor.publish('TestBindEnvironment', async function () {

  if (!this.userId) {
    return null;
  }
  const test = Meteor.bindEnvironment(async () => {
    console.log('bindEnvironment _CurrentPublicationInvocation', DDP._CurrentPublicationInvocation.get());
  });
  await test();

  return this.ready();
});
github-actions[bot] commented 2 weeks ago

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.