I am getting this error message on one of my routes: TypeError: Invalid base URL string. at (middleware.js:16:6) at (node_modules/next/dist/esm/server/web/adapter.js:152:19)
It is saying that the base URL in my middleware is invalid:
return NextResponse.redirect(
new URL("/", process.env.VERCEL_URL || "http://localhost:3000")
);
}```
Is the VERCEL_URL environment variable something I need to set up myself in the Vercel project settings similar to database keys? I thought this was automatically done?
Appreciate any help in fixing this one.