diff --git a/apps/infoalloggi/package.json b/apps/infoalloggi/package.json index 5e1e600..6d9fe94 100644 --- a/apps/infoalloggi/package.json +++ b/apps/infoalloggi/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "build": "next build", + "build": "next build --turbopack", "dev": "node ./headers/dev.js && next dev", "dev-https": "node ./headers/dev-https.js && cross-env NEXT_PUBLIC_BASE_URL='https://localhost:3000' INTERNAL_BASE_URL='https://localhost:3000' next dev --experimental-https", "idev": "cross-env NODE_OPTIONS='--inspect' next dev", diff --git a/apps/infoalloggi/src/providers/SessionProvider.tsx b/apps/infoalloggi/src/providers/SessionProvider.tsx index 7a3cb07..f83bb37 100644 --- a/apps/infoalloggi/src/providers/SessionProvider.tsx +++ b/apps/infoalloggi/src/providers/SessionProvider.tsx @@ -27,6 +27,8 @@ export const SessionProvider: FC<{ children: ReactNode }> = ({ children }) => { data: user, status, isLoading, + isError, + error, } = api.auth.getSession.useQuery(undefined, { refetchOnWindowFocus: true, refetchOnReconnect: true, @@ -35,6 +37,10 @@ export const SessionProvider: FC<{ children: ReactNode }> = ({ children }) => { refetchInterval: 30000, }); + if (isError && error) { + console.error("Session fetch error: ", error); + } + // Invalidate session on route change useEffect(() => { const handleRouteChange = () => { diff --git a/apps/infoalloggi/src/utils/api.ts b/apps/infoalloggi/src/utils/api.ts index 776ae3d..98ef0c9 100644 --- a/apps/infoalloggi/src/utils/api.ts +++ b/apps/infoalloggi/src/utils/api.ts @@ -50,8 +50,8 @@ export const api = createTRPCNext({ errorLink, loggerLink({ enabled: (opts) => - (process.env.NODE_ENV === "development" && - typeof window !== "undefined") || + //(process.env.NODE_ENV === "development" && + typeof window !== "undefined" /* ) */ || (opts.direction === "down" && opts.result instanceof Error), }),