novuhq / novu

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

refactor(framework): Make discovery completely asynchronous #6879

Closed rifont closed 2 weeks ago

rifont commented 2 weeks ago

What changed? Why was the change needed?

Screenshots

next dev --turbopack compatibility is a step closer now, erroring out with module not found rather than the previous require polyfill error.Some further investigation is to identify the root cause for the new problem. Judging by the docs at https://nextjs.org/docs/messages/module-not-found, it's probably: The module you're trying to import uses Node.js specific modules, for example dns, outside of getStaticProps / getStaticPaths / getServerSideProps. Here is the current usage of node built-in modules (node:crypto is used at runtime for HMAC header validation, node:util/types is used for an error type guard).

> next dev --turbopack --port 4000

   ▲ Next.js 15.0.2 (Turbopack)
   - Local:        http://localhost:4000
   - Environments: .env.local

 ✓ Starting...
 ✓ Ready in 748ms
 ○ Compiling /api/novu ...
 ✓ Compiled /api/novu in 555ms
 ⨯ ./src/app/api/novu/route.ts:2:1
Module not found: Can't resolve '@novu/framework'
  1 | import { serve } from '@novu/framework/next';
> 2 | import { workflow } from '@novu/framework';
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  3 |
  4 | const myWorkflow = workflow('welcome-onboarding-2', async ({ step }) => {
  5 |   await step.inApp('send-in-app', async () => ({ body: 'Welcome to our platform!', }));

https://nextjs.org/docs/messages/module-not-found
Expand for optional sections ### Related enterprise PR ### Special notes for your reviewer
netlify[bot] commented 2 weeks ago

Deploy Preview for novu-stg-vite-dashboard-poc failed. Why did it fail? →

Name Link
Latest commit 51200c6638646f4ce4a1631c2d247cbb1e7ca2e0
Latest deploy log https://app.netlify.com/sites/novu-stg-vite-dashboard-poc/deploys/672d3efc76e9e8000878fbe3
pkg-pr-new[bot] commented 2 weeks ago

Open in Stackblitz

pnpm add https://pkg.pr.new/novuhq/novu/@novu/framework@6879

commit: 51200c6