Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

fix(aot): stop Turbopack from bundling server auth into the client (#1771)

bautistaaabeb303dabba0
diff --git a/apps/aot/src/app/events/[year]/[day]/_components/types.ts b/apps/aot/src/app/events/[year]/[day]/_components/types.ts
index 50272746..cd40f904 100644
--- a/apps/aot/src/app/events/[year]/[day]/_components/types.ts
+++ b/apps/aot/src/app/events/[year]/[day]/_components/types.ts
@@ -1,4 +1,4 @@
import type { inferRouterOutputs } from '@trpc/server';
-import type { AppRouter } from '~/server/api/root';
+import type { AppRouter } from '~/trpc/types';
export type Challenge = inferRouterOutputs<AppRouter>['event']['getEventChallengeBySlug'];
diff --git a/apps/aot/src/trpc/react.tsx b/apps/aot/src/trpc/react.tsx
index f551b1a0..0758c9ca 100644
--- a/apps/aot/src/trpc/react.tsx
+++ b/apps/aot/src/trpc/react.tsx
@@ -8,7 +8,7 @@ import { type inferRouterInputs, type inferRouterOutputs } from '@trpc/server';
import { useState } from 'react';
import { default as SuperJSON } from 'superjson';
-import { type AppRouter } from '~/server/api/root';
+import { type AppRouter } from './types';
import { createQueryClient } from './query-client';
let clientQueryClientSingleton: QueryClient | undefined;
diff --git a/apps/aot/src/trpc/types.ts b/apps/aot/src/trpc/types.ts
new file mode 100644
index 00000000..2a126ba1
--- /dev/null
+++ b/apps/aot/src/trpc/types.ts
@@ -0,0 +1 @@
+export type { AppRouter } from '~/server/api/root';
diff --git a/turbo.json b/turbo.json
index 9e6d2429..c2aac9a6 100644
--- a/turbo.json
+++ b/turbo.json
@@ -1,6 +1,6 @@
{
"$schema": "https://turborepo.com/schema.v2.json",
- "globalEnv": ["DATABASE_URL", "NEXT_RUNTIME", "GITHUB_AOT_ID", "GITHUB_AOT_SECRET"],
+ "globalEnv": ["DATABASE_URL", "NEXT_RUNTIME"],
"globalDependencies": [".env", ".env.*"],
"tasks": {
"build": {