Nextjs Build Plugin API Routes Not Found

Hi, I’m trying to host a Next.js v 10 project on Netlify using the Next on Netlify build plugin. Everything seems to work well except my API endpoints aren’t found. Server Side rendering pages are working well but API endpoints are not.

Looking in the Netlify functions tab, the functions appear to be registered but when they are called return a 401.

Here’s the 401.

Here’s the deployed site URL. https://dev-setups.netlify.app/

Hmm, as far as I can tell, the lambda is returning a 401. Is that a possibility for your code to be doing that intentionally? I also see that there were two successes (HTTP 200 results) mixed in with the 401’s in the past hour. Perhaps you’ve learned more in the meantime?

Ahh, well I totally botched this post lol You’re right, that 401 is intentional because the user isn’t logged in. I was mixing this up with the actual problem.

When I try to hit my /api/login API route, it returns this…I’ll probably close this issue and create a new one soon unless you have any initial thoughts on the screenshot below.

Welp, misconfiguration on my side…Thanks!!

1 Like