Skip to content

Commit 58c00e4

Browse files
committed
instrumentation catch to prevent dev crash on migration fail
1 parent 290f65a commit 58c00e4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/instrumentation.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
export async function register() {
22
if (process.env.NEXT_RUNTIME === "nodejs") {
3-
const { runMigrations } = await import("@/lib/db/migrate");
4-
await runMigrations();
3+
try {
4+
const { runMigrations } = await import("@/lib/db/migrate");
5+
await runMigrations();
6+
} catch {
7+
console.log("[instrumentation] skipping migrations, continuing startup");
8+
}
59
}
610
}

0 commit comments

Comments
 (0)