Skip to content

Commit 2ddb0d2

Browse files
committed
fix: next build error
1 parent 1e22169 commit 2ddb0d2

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

apps/web/app/trpc-provider.tsx

+2-9
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,7 @@ import { toast } from 'sonner';
1414
import { useRouter } from 'next/navigation';
1515
import { setAuthCode } from './utils';
1616

17-
const NEXT_PUBLIC_SERVER_ORIGIN_URL = process.env.NEXT_PUBLIC_SERVER_ORIGIN_URL;
18-
19-
if (
20-
NEXT_PUBLIC_SERVER_ORIGIN_URL === undefined ||
21-
NEXT_PUBLIC_SERVER_ORIGIN_URL === ''
22-
) {
23-
throw new Error('app-err: NEXT_PUBLIC_SERVER_ORIGIN_URL is not defined!');
24-
}
17+
const serverOriginUrl = process.env.NEXT_PUBLIC_SERVER_ORIGIN_URL;
2518

2619
export function isTRPCClientError(
2720
cause: unknown,
@@ -98,7 +91,7 @@ export const TrpcProvider: React.FC<{ children: React.ReactNode }> = ({
9891
enabled: () => true,
9992
}),
10093
httpBatchLink({
101-
url: NEXT_PUBLIC_SERVER_ORIGIN_URL + '/trpc',
94+
url: serverOriginUrl + '/trpc',
10295
async headers() {
10396
const token = localStorage.getItem('authCode') || '';
10497

0 commit comments

Comments
 (0)