fix: basePath check

This commit is contained in:
Vyacheslav Matyukhin 2022-04-12 11:57:35 +03:00
parent 651471a961
commit 25fad77f25
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import { IncomingMessage } from "http";
export const reqToBasePath = (req: IncomingMessage) => {
if (process.env.NEXT_PUBLIC_VERCEL_URL) {
console.log(process.env.NEXT_PUBLIC_VERCEL_URL);
return process.env.NEXT_PUBLIC_VERCEL_URL;
}

View File

@ -14,7 +14,7 @@ export async function getDashboardForecastsByDashboardId({
dashboardItem: DashboardItem;
}> {
console.log("getDashboardForecastsByDashboardId: ");
if (window === undefined && !basePath) {
if (typeof window === undefined && !basePath) {
throw new Error("`basePath` option is required on server side");
}