Introduction:
I’m currently working on a Weather Application. I build this Application with the help of Next.js 13 after completing the project i build the project with the help of yarn run build in my local machine it is working fine but when i deploy this project on vercel it’s home page is working but my dynamic routes are not working
gitHub : code Link
2
Answers
It’s impossible to be sure what gone wrong without the logs from Vercel, but at the very least – your
getCityId
useslocalhost
to get data:You need to use relative path, like:
Also make sure that environment variable
API_KEY
for openweathermap is set on Vercel.…Try full dynamic page with adding
export const dynamic = 'force-dynamic';
to the..location/[city] /page.js
( and basically removenext: {revalidate: 10000}
from fetches) — maybe issues’re caused by inconsistencies btw server-prerendered (which should be the default city?) and dynamically rendered on the fly [city] pages …(also, why not to set
title=
${cityreport.city.name} Weather – Next Weather Appto
metadata` object itself (as by docs) …