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

🐛 Bug Report: @novu/node doesn't support Nuxt 3 with Cloudflare Workers #7503

Open
2 tasks done
hugo082 opened this issue Jan 14, 2025 · 1 comment
Open
2 tasks done
Labels

Comments

@hugo082
Copy link

hugo082 commented Jan 14, 2025

📜 Description

Instantiating the client result in an error

const novu = new Novu("...", {
  backendUrl: "...",
})

👟 Reproduction steps

  1. Instantiate the client in a server endpoint.
  2. Deploy it to cloudflare workers

👍 Expected behavior

It should return the client instance

👎 Actual Behavior with Screenshots

TypeError: Class constructor EventEmitter cannot be invoked without 'new'
    at new Novu (chunks/nitro/nitro.mjs:1:800770)
    ...

Novu version

Novu SAAS

npm version

No response

node version

cloudflare workers

📃 Provide any additional context for the Bug.

It actually imports the version of the package where the class extends is replaced by functions.

// node_modules/@novu/node/build/main/lib/novu.js
var Novu = (function (_super) {
    __extends(Novu, _super);
    function Novu() {
        // ...
    return Novu;
}(events_1.EventEmitter));

The issue is probably related to the wrong definition in the package "module" property, you can have a look to publint for details, "module" should define ESM entry and it seems the code actually referenced is CSJ.

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

Copy link

linear bot commented Jan 14, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant