🐛 Fix 404 error page

Wasn't working because of ssr prop from trpc
This commit is contained in:
Baptiste Arnaud
2023-02-14 15:09:05 +01:00
parent 08e33fbe70
commit eef015e395
8 changed files with 29 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
import { httpBatchLink } from '@trpc/client'
import { httpBatchLink, loggerLink } from '@trpc/client'
import { createTRPCNext } from '@trpc/next'
import type { AppRouter } from '../utils/server/routers/v1/trpcRouter'
import superjson from 'superjson'
@@ -10,6 +10,11 @@ export const trpc = createTRPCNext<AppRouter>({
config() {
return {
links: [
loggerLink({
enabled: (opts) =>
process.env.NODE_ENV === 'development' ||
(opts.direction === 'down' && opts.result instanceof Error),
}),
httpBatchLink({
url: `${getBaseUrl()}/api/trpc`,
}),
@@ -17,5 +22,5 @@ export const trpc = createTRPCNext<AppRouter>({
transformer: superjson,
}
},
ssr: true,
ssr: false,
})