Skip to content

Commit 4ea4862

Browse files
upgrade next
1 parent a2f80a2 commit 4ea4862

File tree

8 files changed

+1290
-463
lines changed

8 files changed

+1290
-463
lines changed

packages/web/next.config.mjs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ const nextConfig = {
5454

5555
export default withSentryConfig(nextConfig, {
5656
// For all available options, see:
57-
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
58-
5957
org: process.env.SENTRY_ORG,
6058
project: process.env.SENTRY_WEBAPP_PROJECT,
6159
authToken: process.env.SENTRY_SMUAT,
@@ -70,23 +68,9 @@ export default withSentryConfig(nextConfig, {
7068
// Upload a larger set of source maps for prettier stack traces (increases build time)
7169
widenClientFileUpload: true,
7270

73-
// Automatically annotate React components to show their full name in breadcrumbs and session replay
74-
reactComponentAnnotation: {
75-
enabled: true,
76-
},
77-
7871
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
7972
// This can increase your server load as well as your hosting bill.
8073
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
8174
// side errors will fail.
8275
tunnelRoute: "/monitoring",
83-
84-
// Automatically tree-shake Sentry logger statements to reduce bundle size
85-
disableLogger: true,
86-
87-
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
88-
// See the following for more information:
89-
// https://docs.sentry.io/product/crons/
90-
// https://vercel.com/docs/cron-jobs
91-
automaticVercelMonitors: true,
9276
});

packages/web/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"@replit/codemirror-lang-solidity": "^6.0.2",
9393
"@replit/codemirror-lang-svelte": "^6.0.0",
9494
"@replit/codemirror-vim": "^6.2.1",
95-
"@sentry/nextjs": "^9",
95+
"@sentry/nextjs": "^10.40.0",
9696
"@shopify/lang-jsonc": "^1.0.0",
9797
"@sourcebot/codemirror-lang-tcl": "^1.0.12",
9898
"@sourcebot/db": "workspace:*",
@@ -151,7 +151,7 @@
151151
"linguist-languages": "^9.3.1",
152152
"lucide-react": "^0.517.0",
153153
"micromatch": "^4.0.8",
154-
"next": "15.5.10",
154+
"next": "16.1.6",
155155
"next-auth": "^5.0.0-beta.30",
156156
"next-navigation-guard": "^0.2.0",
157157
"next-themes": "^0.3.0",
@@ -163,9 +163,9 @@
163163
"posthog-node": "^5.24.15",
164164
"pretty-bytes": "^6.1.1",
165165
"psl": "^1.15.0",
166-
"react": "^19.2.1",
166+
"react": "19.2.4",
167167
"react-device-detect": "^2.2.3",
168-
"react-dom": "^19.2.1",
168+
"react-dom": "19.2.4",
169169
"react-hook-form": "^7.53.0",
170170
"react-hotkeys-hook": "^4.5.1",
171171
"react-icons": "^5.3.0",
@@ -202,13 +202,13 @@
202202
"@types/node": "^20",
203203
"@types/nodemailer": "^6.4.17",
204204
"@types/psl": "^1.1.3",
205-
"@types/react": "19.2.1",
206-
"@types/react-dom": "19.2.1",
205+
"@types/react": "19.2.14",
206+
"@types/react-dom": "19.2.3",
207207
"@typescript-eslint/eslint-plugin": "^8.40.0",
208208
"@typescript-eslint/parser": "^8.40.0",
209209
"cross-env": "^7.0.3",
210210
"eslint": "^8",
211-
"eslint-config-next": "15.5.0",
211+
"eslint-config-next": "16.1.6",
212212
"eslint-plugin-react": "^7.37.5",
213213
"eslint-plugin-react-hooks": "^5.2.0",
214214
"jsdom": "^25.0.1",
@@ -223,7 +223,7 @@
223223
"vitest-mock-extended": "^3.1.0"
224224
},
225225
"resolutions": {
226-
"@types/react": "19.2.1",
227-
"@types/react-dom": "19.2.1"
226+
"@types/react": "19.2.14",
227+
"@types/react-dom": "19.2.3"
228228
}
229229
}

packages/web/src/app/page.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
import { auth } from "@/auth";
22
import { redirect } from "next/navigation";
33
import { SINGLE_TENANT_ORG_DOMAIN } from "@/lib/constants";
4-
import { getOrgFromDomain } from "@/data/org";
4+
import { prisma } from "@/prisma";
5+
6+
// @note: we were hitting `PrismaClientInitializationError` errors during
7+
// build time. Next.js performs a static generation probe on all pages during
8+
// `next build`, running each page component to determine if it's static or
9+
// dynamic. `force-dynamic` skips the probe entirely so this page is always
10+
// rendered at request time.
11+
export const dynamic = 'force-dynamic';
512

613
export default async function Page() {
7-
const org = await getOrgFromDomain(SINGLE_TENANT_ORG_DOMAIN);
14+
const org = await prisma.org.findUnique({
15+
where: {
16+
domain: SINGLE_TENANT_ORG_DOMAIN
17+
}
18+
});
819

920
if (!org || !org.isOnboarded) {
1021
return redirect("/onboard");

packages/web/src/data/org.ts

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,11 @@ import 'server-only';
22
import { prisma } from '@/prisma';
33

44
export const getOrgFromDomain = async (domain: string) => {
5-
try {
6-
const org = await prisma.org.findUnique({
7-
where: {
8-
domain: domain
9-
}
10-
});
5+
const org = await prisma.org.findUnique({
6+
where: {
7+
domain: domain
8+
}
9+
});
1110

12-
return org;
13-
} catch (error) {
14-
// During build time we won't be able to access the database, so we catch and return null in this case
15-
// so that we can statically build pages that hit the DB (ex. to check if the org is onboarded)
16-
console.error('Error fetching org from domain:', error);
17-
return null;
18-
}
11+
return org;
1912
}

packages/web/src/instrumentation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export async function register() {
2626
await import('../sentry.edge.config');
2727
}
2828

29-
if (process.env.NEXT_RUNTIME === 'nodejs') {
30-
await import('./initialize');
31-
}
29+
// if (process.env.NEXT_RUNTIME === 'nodejs') {
30+
// await import('./initialize');
31+
// }
3232
}
3333

3434
export const onRequestError = Sentry.captureRequestError;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NextResponse } from 'next/server'
22
import type { NextRequest } from 'next/server'
33
import { SINGLE_TENANT_ORG_DOMAIN } from '@/lib/constants'
44

5-
export async function middleware(request: NextRequest) {
5+
export async function proxy(request: NextRequest) {
66
const url = request.nextUrl.clone();
77

88
if (

packages/web/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"moduleResolution": "bundler",
1515
"resolveJsonModule": true,
1616
"isolatedModules": true,
17-
"jsx": "preserve",
17+
"jsx": "react-jsx",
1818
"incremental": true,
1919
"plugins": [
2020
{

0 commit comments

Comments
 (0)