N
Nuxt10mo ago
sykes10667

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.
No description
3 Replies
sykes10667
sykes10667OP10mo ago
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?
manniL
manniL10mo ago
can you provide a reproduction?
sykes10667
sykes10667OP10mo ago
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
Want results from more Discord servers?
Add your server