#Error
1 messages · Page 1 of 1 (latest)
Hmm, I don't know enough to give you a confident answer yet. The error message you're seeing is related to the next function not being recognized. This could be due to a variety of reasons such as incorrect import, wrong usage, or a conflict with another package.
In the context of Next.js, next is usually imported from the next package like so:
const next = require('next')
And it's used to create a Next.js application:
const app = next({})
You can find more details about this in the Next.js documentation (https://nextjs.org/docs/pages/building-your-application/configuring/custom-server).
However, your error seems to be coming from the passport library, which is not directly related to Next.js. The next function in this context is usually a middleware function passed to route handlers in Express.js, not a function imported from a package.
I recommend checking your code to ensure you're using the next function correctly in the context of your application. If you're using Next.js with a custom server like Express.js, make sure to follow the guidelines in the Next.js custom server documentation (https://nextjs.org/docs/pages/building-your-application/configuring/custom-server).
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@hard badger kapa.ai is still learning and improving, please let us know how it did by reacting below
@runic dock - error No HTTP methods exported in '/root/website/src/app/api/auth/discord/call
Let me check the knowledge base for you. One moment! :books:
The error message you're seeing indicates that no HTTP methods are being exported in your /root/website/src/app/api/auth/discord/call file. In Next.js, when you're creating API routes, you need to export functions that correspond to HTTP methods.
For example, if you want to handle a GET request, you would export an async function named GET. Here's an example from the Next.js documentation (https://nextjs.org/docs/app/api-reference/file-conventions/route):
export async function GET(request: Request) {
// Your GET request handling code here
}
You can do the same for other HTTP methods like POST, PUT, DELETE, etc. If you don't export any of these functions, Next.js won't know how to handle incoming requests to that route, hence the error message.