NextJS Error 500 after deploy when fetching data on API route

Hi,

I am using NextJS 14 (https://my-weight-jr.netlify.app/) and, after deploying to Netlify, I’m getting this 500 error “Failed to load resource: the server responded with a status of 500 ()” when the app tries to fetch data from /api/weight…

Thanks in advance for your help and, most importantly, your time!

Next.js 14 doesn’t work on Netlify yet.

1 Like

Well, thanks for your reply!

I have just created a new project using NextJS 13, made a new deploy on Netlify and I am still getting the same 500 error when calling the api routes… Everything works locally.

Hi @joaovcostas,

We recommend v 13.4 at the latest. Looks like you’re currently on 13.5.6. Could you give this a try and let us know if you continue to have issues?

1 Like

Hi,

Ok, I’ll try.
Thanks for your attention!

@Melvin,
I changed to v 13.4.19 and the error remained…

Check your Function logs: Function details | Functions | Logs | my-weight-jr | Netlify

This error has nothing to do with Netlify

1 Like

I see it.

It’s very strange because the code appears to be correct. I found some similar erros on web but none of them apply to my project. Every solution proposed to these cases is already implemented here…

Have you any insight on what it could be?

I am thankful for your support!

Apparently it works now!

I removed the quotes from the env variables and added to them a timeout configuration term and the code is working after deployment.

thanks for sharing this with the community!

Hi @Melvin

Could you give us an idea of when you plan to support Next 14?

Also, I haven’t been able to find this in your docs; is there somewhere we can see the version support for Next (and other frameworks) at any given time? Currently this looks like a blocker to upgrading one of our apps, it would have been useful for us to know about this ahead of time.

2 Likes

The latest versions of all frameworks more or less work on Netlify. Any version actively maintained by the framework itself should also work. Older versions might work, but if a framework itself has dropped support for it, we don’t provide much troubleshooting with it either.

As for Next.js, things are different, since it’s owned and maintained by our direct competitor. Most other frameworks maintain their own integrations with Netlify, but for Next.js, we have to read the code, sometimes reverse engineer and create our own integration to make it work. This takes time and creates more issues with every new version’s breaking changes.

For Next.js 14, we aim to release a beta stability in the upcoming weeks.