novuhq / novu

Open-Source Notification Platform. Embeddable Notification Center, E-mail, Push and Slack Integrations.
https://novu.co
Other
33.67k stars 3.46k forks source link

πŸ› Bug Report: Class constructor EventEmitter cannot be invoked without 'new' #5840

Open kyng-cytro opened 4 days ago

kyng-cytro commented 4 days ago

πŸ“œ Description

Hi. I recently deployed my nuxt app to Cloudflare and I get this error every time I try to register a new subscriber. Class constructor EventEmitter cannot be invoked without 'new'

Here's my function code

export const registerSubscriber = async (subscriber: User) => {
  const [firstName, lastName] = subscriber.name.split(" ");
  await novu.subscribers.identify(subscriber.id, {
    firstName,
    lastName,
    email: subscriber.email,
    ...(subscriber.picture && { avatar: subscriber.picture }),
  });
};

Probably has something to do with Cloudflare?

πŸ‘Ÿ Reproduction steps

πŸ‘ Expected behavior

No error and the subscriber should be registered successfully

πŸ‘Ž Actual Behavior with Screenshots

Error Class constructor EventEmitter cannot be invoked without 'new'

My App:

image Nuxt Hub/ Cloudflare logs:

image

Novu version

Novu SaaS

npm version

NA

node version

NA

πŸ“ƒ Provide any additional context for the Bug.

No response

πŸ‘€ Have you spent some time to check if this bug has been raised before?

🏒 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

linear[bot] commented 4 days ago

NV-3954 πŸ› Bug Report: Class constructor EventEmitter cannot be invoked without 'new'