Skip to content

🐛 Bug Report: Next 15 fails to build with Novu serve() #6881

@jklinehamer

Description

@jklinehamer

📜 Description

Trying to build for production

👟 Reproduction steps

  1. Install Novu with a Next 15 app as described in the Novu setup guide
  2. Create the route handler using Novu's serve() function as explained in the docs
  3. Try building your app

👍 Expected behavior

Build successfully

👎 Actual Behavior with Screenshots

Fails to compile
CleanShot 2024-11-07 at 03 20 22

Novu version

Novu SaaS

npm version

No response

node version

No response

📃 Provide any additional context for the Bug.

After NextJS 15 the typing changed for Route Handlers. The second argument is now of type "RouteContext", which causes this error.

Inngest, another open source project with very similar structure to Novu, has resolved the issue for their product. The relevant source code from Inngest (and how they fixed the issue) can be found here: https://github.com/inngest/inngest-js/blob/main/packages/inngest/src/next.ts

Using their source I was able to create a custom Novu serve() function and get this working, but it would be nice to have this out-of-the-box with Novu.

👀 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions