N
Novu7mo ago
KaisSalha

Issue with importing serve function

I'm trying to follow this guide: https://docs.novu.co/echo/concepts/endpoint and this is broken: import { EchoRequestHandler, ServeHandlerOptions } from '@novu/echo'; Those aren't exported from the package
7 Replies
Ask Inkeep
Ask Inkeep7mo ago
Hi @KaisSalha, I'm an AI assistant for Novu. While a team member reviews this question, I'll see if I can find relevant sources for your question. ----------------------------- While I generate an answer, here are some sources that might be helpful: * Integrate Novu with Nuxt * Integrate Novu with Next.js * Introduction * Quick Start -----------------------------
Ask Inkeep
Ask Inkeep7mo ago
Answer It appears that the imports EchoRequestHandler and ServeHandlerOptions you are trying to use are not directly mentioned in the provided documentation extracts. However, the correct import for the serve function from the @novu/echo package should look like this:
import { serve } from "@novu/echo/nuxt"; // For Nuxt.js integration
// or
import { serve } from "@novu/echo/next"; // For Next.js integration
import { serve } from "@novu/echo/nuxt"; // For Nuxt.js integration
// or
import { serve } from "@novu/echo/next"; // For Next.js integration
(1) , (2) These snippets show how to properly use the serve function within Nuxt.js and Next.js frameworks respectively. If EchoRequestHandler and ServeHandlerOptions are not being found, it's possible they might not be exported or could be part of a different version or package. Please ensure you are using the correct version of the package that supports these exports, or check the latest documentation or the repository for any recent changes that might have deprecated or moved these exports.
KaisSalha
KaisSalhaOP7mo ago
I'm intergrating it with Fastify so I'll have to go the manual route. I'm on the latest available version: "@novu/echo": "0.24.3-alpha.0",
Pawan Jain
Pawan Jain7mo ago
@KaisSalha Thanks for sharing. We are working on fix
DominusPrime
DominusPrime2w ago
Does novu not work with Fastify for some reason?
Pawan Jain
Pawan Jain2w ago
@DominusPrime Are you using nestjs + fastify?
DominusPrime
DominusPrime2w ago
We want to, but haven't been able to get it to work with Fastify just yet So for now we're using nestjs + express with novu. In our other projects we've had less problems when using nestjs + fastify, so we've made a policy to only use fastify, so it feels a bit weird now to have a problem using it with novu.
Want results from more Discord servers?
Add your server