Nuxt not generating server routes
I am trying to create a couple of server routes in Nuxt but It does not seem to work. When I look at the type definition I can only see /__nuxt_error. I cannot provide a reproducible environment because our app is quite complex but I wonder if someone had similar issues previously or maybe they have any idea about why this could be happening.
Something that might help is that every time I do a request to the API I get a
page not found: /api/test
.3 Replies
It turns out that I need to manually add the routes to nuxtConfig.nitro.handlers for it to work. Does anyone have any guess why nuxt is not autogenerating things from inside the server folder?
can you provide a reproduction?
Sorry but that only happens in my codebase and it’s impossible to provide a reproduction. Too many variables and I couldn’t find anything that will fix it so far besides adding things manually