- 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.2k
 
Open
Description
📜 Description
novu.serve when used with next 15.5, throws errors when being built.
  // Export named HTTP methods
   export const GET = serve({ workflows })
  export const POST = serve({ workflows })
  export const OPTIONS = serve({ workflows })
It didn't happen with the previous i.e. 15.4.x versions.
Errors:
        Types of parameters 'event' and 'event' are incompatible.
        @yobr/platform:build:                   Type 'import("/Users/prakharshukla/Code/yobr/Yobplatform/.conductor/prakhar-yobr-870-new-simplified-flow/node_modules/.pnpm/@[email protected][email protected]_@[email protected]_babel-plugin-react-compiler@_307f2043a84faea25b3330a8d3688afe/node_modules/@novu/framework/dist/esm/health-check.types-D6N1lsYH").aq<Record<...' is not assignable to type 'import("/Users/prakharshukla/Code/yobr/Yobplatform/.conductor/prakhar-yobr-870-new-simplified-flow/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]._915bddd47214dcc8612013c42c461992/node_modules/@novu/framework/dist/esm/health-check.types-D6N1lsYH").aq<Record<...'.
           Types of parameters 'event' and 'event' are incompatible.
        @yobr/platform:build:                   Type 'import("/Users/prakharshukla/Code/yobr/Yobplatform/.conductor/prakhar-yobr-870-new-simplified-flow/node_modules/.pnpm/@[email protected][email protected]_@[email protected]_babel-plugin-react-compiler@_307f2043a84faea25b3330a8d3688afe/node_modules/@novu/framework/dist/esm/health-check.types-D6N1lsYH").aq<Record<...' is not assignable to type 'import("/Users/prakharshukla/Code/yobr/Yobplatform/.conductor/prakhar-yobr-870-new-simplified-flow/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]._915bddd47214dcc8612013c42c461992/node_modules/@novu/framework/dist/esm/health-check.types-D6N1lsYH").aq<Record<...'.
        @yobr/platform:build:                     The types of 'step.custom' are incompatible between these types.
        @yobr/platform:build:                       Types of parameters 'resolve' and 'resolve' are incompatible.
        @yobr/platform:build:                         Type 'Awaitable<T_Outputs>' is not assignable to type 'Awaitable<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                           Type 'T_Outputs' is not assignable to type 'Awaitable<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                             Type 'T_IntermediaryOutput' is not assignable to type 'Awaitable<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                               Type 'Record<string, unknown>' is not assignable to type 'Awaitable<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                                 Type 'Record<string, unknown>' is missing the following properties from type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>': then, catch, finally, [Symbol.toStringTag]
        @yobr/platform:build:                                   Type 'T_IntermediaryOutput' is not assignable to type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                                     Type 'Record<string, unknown>' is missing the following properties from type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>': then, catch, finally, [Symbol.toStringTag]
        @yobr/platform:build:                                       Type 'T_Outputs' is not assignable to type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                                         Type 'T_IntermediaryOutput' is not assignable to type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                                           Type 'Record<string, unknown>' is missing the following properties from type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>': then, catch, finally, [Symbol.toStringTag]
      ```
### 👟 Reproduction steps
1. Upgrade to next 15.5.
2. have a route serving novu workflows like this:
```ts
import { serve } from '@novu/framework/next'
import {
  jobUpdateRejected,
} from '@yobr/trpc/novu/workflows'
// Collect all workflows
const workflows = [
  jobUpdateRejected,
]
// // Export named HTTP methods
export const GET = serve({ workflows })
export const POST = serve({ workflows })
export const OPTIONS = serve({ workflows })
👍 Expected behavior
It should build successfully, commenting the .serve function makes it build.
👎 Actual Behavior with Screenshots
Errors:
        Types of parameters 'event' and 'event' are incompatible.
        @yobr/platform:build:                   Type 'import("/Users/prakharshukla/Code/yobr/Yobplatform/.conductor/prakhar-yobr-870-new-simplified-flow/node_modules/.pnpm/@[email protected][email protected]_@[email protected]_babel-plugin-react-compiler@_307f2043a84faea25b3330a8d3688afe/node_modules/@novu/framework/dist/esm/health-check.types-D6N1lsYH").aq<Record<...' is not assignable to type 'import("/Users/prakharshukla/Code/yobr/Yobplatform/.conductor/prakhar-yobr-870-new-simplified-flow/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]._915bddd47214dcc8612013c42c461992/node_modules/@novu/framework/dist/esm/health-check.types-D6N1lsYH").aq<Record<...'.
           Types of parameters 'event' and 'event' are incompatible.
        @yobr/platform:build:                   Type 'import("/Users/prakharshukla/Code/yobr/Yobplatform/.conductor/prakhar-yobr-870-new-simplified-flow/node_modules/.pnpm/@[email protected][email protected]_@[email protected]_babel-plugin-react-compiler@_307f2043a84faea25b3330a8d3688afe/node_modules/@novu/framework/dist/esm/health-check.types-D6N1lsYH").aq<Record<...' is not assignable to type 'import("/Users/prakharshukla/Code/yobr/Yobplatform/.conductor/prakhar-yobr-870-new-simplified-flow/node_modules/.pnpm/@[email protected][email protected]_@[email protected][email protected][email protected]._915bddd47214dcc8612013c42c461992/node_modules/@novu/framework/dist/esm/health-check.types-D6N1lsYH").aq<Record<...'.
        @yobr/platform:build:                     The types of 'step.custom' are incompatible between these types.
        @yobr/platform:build:                       Types of parameters 'resolve' and 'resolve' are incompatible.
        @yobr/platform:build:                         Type 'Awaitable<T_Outputs>' is not assignable to type 'Awaitable<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                           Type 'T_Outputs' is not assignable to type 'Awaitable<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                             Type 'T_IntermediaryOutput' is not assignable to type 'Awaitable<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                               Type 'Record<string, unknown>' is not assignable to type 'Awaitable<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                                 Type 'Record<string, unknown>' is missing the following properties from type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>': then, catch, finally, [Symbol.toStringTag]
        @yobr/platform:build:                                   Type 'T_IntermediaryOutput' is not assignable to type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                                     Type 'Record<string, unknown>' is missing the following properties from type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>': then, catch, finally, [Symbol.toStringTag]
        @yobr/platform:build:                                       Type 'T_Outputs' is not assignable to type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                                         Type 'T_IntermediaryOutput' is not assignable to type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>'.
        @yobr/platform:build:                                           Type 'Record<string, unknown>' is missing the following properties from type 'Promise<FromSchemaUnvalidated<T_OutputsSchema>>': then, catch, finally, [Symbol.toStringTag]
      ```
### Novu version
Novu Saas
### npm version
10.9.2
### node version
v23.7.0
### 📃 Provide any additional context for the Bug.
_No response_
### 👀 Have you spent some time to check if this bug has been raised before?
- [x] I checked and didn't find a similar issue
### 🏢 Have you read the Contributing Guidelines?
- [x] I have read the [Contributing Guidelines](https://github.com/novuhq/novu/blob/main/CONTRIBUTING.md)
### Are you willing to submit PR?
Yes I am willing to submit a PR!