Open arnaud0617 opened 5 months ago
I have this same issue, anyone?
Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!
This example is also outdated and might require fixing: https://github.com/vercel/examples/blob/main/python/nextjs-flask/next.config.js
Link to the code that reproduces this issue
https://github.com/arnaud0617/nextjs-boilerplate
To Reproduce
I deployed the NexJS-boilerplate on vercel : it works
I added flask and it works locally http://localhost:3000/api/hello > return the right message "Hello! This is Arnaud, from Flask"
I uploaded in Vercel and get the error "https://****-projects.vercel.app/" is still working "https://***-projects.vercel.app/api/hello" is not working
I get the following error 404: NOT_FOUND Code: DNS_HOSTNAME_RESOLVED_PRIVATE ID: sfo1::n8s7h-1717543156736-e703ce3d0392
index.py from flask import Flask app = Flask(name)
@app.route('/api/hello', methods=['GET']) def hello_world(): return "Hello! This is Arnaud, from Flask"
if name == 'main': app.run(debug=True, port=5328)
next.config.js module.exports = { async rewrites() { return [ { source: '/api/:path', destination: 'http://localhost:5328/api/:path', // Proxy to Backend }, ] }, }
requirements.txt Flask==3.0.3
Current vs. Expected behavior
I deployed the NexJS-boilerplate on vercel : it works
I added flask and it works locally http://localhost:3000/api/hello > return the right message "Hello! This is Arnaud, from Flask"
I uploaded in Vercel and I does not work. I get the error 404: NOT_FOUND Code: DNS_HOSTNAME_RESOLVED_PRIVATE ID: sfo1::n8s7h-1717543156736-e703ce3d0392
index.py from flask import Flask app = Flask(name)
@app.route('/api/hello', methods=['GET']) def hello_world(): return "Hello! This is Arnaud, from Flask"
if name == 'main': app.run(debug=True, port=5328)
next.config.js module.exports = { async rewrites() { return [ { source: '/api/:path', destination: 'http://localhost:5328/api/:path', // Proxy to Backend }, ] }, }
requirements.txt Flask==3.0.3
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure, create-next-app, Script (next/script)
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
No response