meteor-collection-hooks icon indicating copy to clipboard operation
meteor-collection-hooks copied to clipboard

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

Open aboire opened this issue 1 year ago • 1 comments

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();
});

aboire avatar Aug 28 '24 10:08 aboire

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.

github-actions[bot] avatar Aug 28 '24 10:08 github-actions[bot]

@aboire which version of this package and version of Meteor did this occur?

jankapunkt avatar Nov 21 '24 19:11 jankapunkt

@jankapunkt The pull request from @nachocodoner fixed the issue; I will close it.

aboire avatar Nov 21 '24 20:11 aboire