examples icon indicating copy to clipboard operation
examples copied to clipboard

Next.js + Flask fails in production

Open bernatfortet opened this issue 2 years ago • 2 comments

I'm visiting the url: https://nextjs-flask-starter.vercel.app/ which is your official demo of this Next.js + flask example and I'm getting an error when going to https://nextjs-flask-starter.vercel.app/api

image

Additionally, would you be so kind to show an example of sub paths? e.g. /api/echo

I think @steven-tey created the example

bernatfortet avatar Nov 19 '23 01:11 bernatfortet

It appears Vercel's demo still doesnt work if you go to https://nextjs-flask-starter.vercel.app/api/python, which the code suggests is a valid API route.

I'm going to try with the FastAPI Template, as at least its demo works, so I can reverse engineer.

benfwalla avatar Jan 11 '24 04:01 benfwalla

has this been resolved? the demo still doesnt work, while annoyingly it works locally

chrispepper1989 avatar Mar 20 '24 11:03 chrispepper1989

Bump

JavaScriptJohn avatar Jun 07 '24 19:06 JavaScriptJohn

Resolved by https://github.com/vercel/examples/pull/927 I believe. Please reopen and @ me if not!

trek avatar Jun 17 '24 23:06 trek

@trek The starter is still broken, I ran the "deploy" right from the site https://vercel.com/templates/next.js/nextjs-flask-starter - and the initial build failed.

I have my own repo based of that starter and I got the deploy/build to work, but the Flask API route does not work (it works locally), still trying to figure out why.

robbiecren07 avatar Jul 15 '24 02:07 robbiecren07

@trek Same thing. I got my configuration to work perfectly fine locally but I keep getting a 405 error when I call the route in production which is weird because the POST route I have configured works fine locally but then all of a sudden it can't find it in prod.

31Carlton7 avatar Aug 11 '24 21:08 31Carlton7