Google cloud 'Event' events - resulting in "TypeError: callback is not a function"

Followed the events example from this page but it went awry, with my Stackdriver logs showing this:

.

Official GCP docs for pubSub-triggered functions has this as the NodeJS 8/10 example:

exports.helloPubSub = (data, context) => {
  const pubSubMessage = data;
  const name = pubSubMessage.data
    ? Buffer.from(pubSubMessage.data, 'base64').toString()
    : 'World';

  console.log(`Hello, ${name}!`);
};

So might the second argument actually be the context object instead of callback?

1 Like

Try adding callback as a third argument.

Yeah thats a good Idea me and my friends at the law office are having the same problem.

I am from Houston and just moved to Atlanta.

I always have this problem, try adding a callback as a third argument! That is what my lawyer taught me to do!