From 49ed338d812273582a8a5ffb42c666688708b852 Mon Sep 17 00:00:00 2001 From: nickreynolds Date: Tue, 7 Jan 2025 13:36:04 -0500 Subject: [PATCH] chore: PR feedback --- README.md | 6 ++---- apps/nextjs/src/app/api/auth/[...nextauth]/route.ts | 3 ++- apps/nextjs/src/app/api/trpc/[trpc]/route.ts | 3 ++- apps/nextjs/src/app/page.tsx | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0deb3b81a..b2b590a6f 100644 --- a/README.md +++ b/README.md @@ -76,10 +76,8 @@ tooling ## Quick Start > **Note** -> The [db](./packages/db) package is preconfigured to use Supabase and is **edge-bound** with the [Vercel Postgres](https://github.com/vercel/storage/tree/main/packages/postgres) driver. If you're using something else, make the necessary modifications to the [schema](./packages/db/src/schema.ts) as well as the [client](./packages/db/src/index.ts) and the [drizzle config](./packages/db/drizzle.config.ts). If you want to switch to non-edge database driver, remove `export const runtime = process.platform === "win32" ? "nodejs" : "edge";` [from all pages and api routes](https://github.com/t3-oss/create-t3-turbo/issues/634#issuecomment-1730240214). - -> **Note** -> There is currently a [bug](https://github.com/vercel/next.js/issues/53562) that prevents using the edge runtime when developing a `Next.js` app on Windows with `turborepo`. Because of this bug, we check the platform when exporting the `runtime` variable and default to the `nodejs` runtime if the process is running on Windows. +> Due to a [bug](https://github.com/vercel/next.js/issues/53562) affecting windows development, the edge runtime is currently disabled by default. If your environment supports it, you can enable the edge runtime by adding the line `export const runtime = "edge";` [to all pages and api routes](https://github.com/t3-oss/create-t3-turbo/issues/634#issuecomment-1730240214). The pages and routes included in this template include this line commented out, for illustration purposes. +> The [db](./packages/db) package is preconfigured to use Supabase and is **edge-bound** with the [Vercel Postgres](https://github.com/vercel/storage/tree/main/packages/postgres) driver. If you're using something else, make the necessary modifications to the [schema](./packages/db/src/schema.ts) as well as the [client](./packages/db/src/index.ts) and the [drizzle config](./packages/db/drizzle.config.ts). To get it running, follow the steps below: diff --git a/apps/nextjs/src/app/api/auth/[...nextauth]/route.ts b/apps/nextjs/src/app/api/auth/[...nextauth]/route.ts index 3f1f93d45..dcf224912 100644 --- a/apps/nextjs/src/app/api/auth/[...nextauth]/route.ts +++ b/apps/nextjs/src/app/api/auth/[...nextauth]/route.ts @@ -3,7 +3,8 @@ import { NextRequest, NextResponse } from "next/server"; import { handlers, isSecureContext } from "@acme/auth"; -export const runtime = process.platform === "win32" ? "nodejs" : "edge"; +// Uncomment this line to enable edge runtime if your environment supports it +// export const runtime = "edge"; const EXPO_COOKIE_NAME = "__acme-expo-redirect-state"; const AUTH_COOKIE_PATTERN = /authjs\.session-token=([^;]+)/; diff --git a/apps/nextjs/src/app/api/trpc/[trpc]/route.ts b/apps/nextjs/src/app/api/trpc/[trpc]/route.ts index f2f564278..6ec6fa5c9 100644 --- a/apps/nextjs/src/app/api/trpc/[trpc]/route.ts +++ b/apps/nextjs/src/app/api/trpc/[trpc]/route.ts @@ -3,7 +3,8 @@ import { fetchRequestHandler } from "@trpc/server/adapters/fetch"; import { appRouter, createTRPCContext } from "@acme/api"; import { auth } from "@acme/auth"; -export const runtime = process.platform === "win32" ? "nodejs" : "edge"; +// Uncomment this line to enable edge runtime if your environment supports it +// export const runtime = "edge"; /** * Configure basic CORS headers diff --git a/apps/nextjs/src/app/page.tsx b/apps/nextjs/src/app/page.tsx index 91d3797da..0d2abca9c 100644 --- a/apps/nextjs/src/app/page.tsx +++ b/apps/nextjs/src/app/page.tsx @@ -8,7 +8,8 @@ import { PostList, } from "./_components/posts"; -export const runtime = process.platform === "win32" ? "nodejs" : "edge"; +// Uncomment this line to enable edge runtime if your environment supports it +// export const runtime = "edge"; export default function HomePage() { // You can await this here if you don't want to show Suspense fallback below