Skip to content

Commit

Permalink
fix: 修复初始化运行时导包问题
Browse files Browse the repository at this point in the history
  • Loading branch information
besscroft committed May 5, 2024
1 parent e7e3eef commit 2b50428
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion instrumentation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PrismaClient } from '@prisma/client'
import cuid from 'cuid'

export async function register() {
try {
Expand All @@ -8,6 +7,8 @@ export async function register() {
}
const prisma = new PrismaClient()
if (prisma) {
const cuidModule = await import('cuid')
const cuid = cuidModule.default
await prisma.$transaction(async (tx) => {
await tx.$executeRaw`
INSERT INTO "public"."User" (id, name, email, password, image)
Expand Down

0 comments on commit 2b50428

Please sign in to comment.