我正在尝试部署到 Vercel,但由于以下问题,我的部署崩溃了:
PrismaClientInitializationError: Prisma has detected that this project was built on Vercel, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the `prisma generate` command during the build process.
Learn how: https://pris.ly/d/vercel-build
at eu (/vercel/path0/node_modules/@prisma/client/runtime/library.js:164:69)
at new t (/vercel/path0/node_modules/@prisma/client/runtime/library.js:177:3203)
at 40754 (/vercel/path0/.next/server/chunks/578.js:138:37)
at __webpack_require__ (/vercel/path0/.next/server/webpack-runtime.js:25:43)
at 76578 (/vercel/path0/.next/server/chunks/578.js:23:16)
at __webpack_require__ (/vercel/path0/.next/server/webpack-runtime.js:25:43)
at 32631 (/vercel/path0/.next/server/app/(site)/home/page.js:4370:22)
at Function.__webpack_require__ (/vercel/path0/.next/server/webpack-runtime.js:25:43)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async collectGenerateParams (/vercel/path0/node_modules/next/dist/build/utils.js:822:17) {
clientVersion: …Run Code Online (Sandbox Code Playgroud) 我正在尝试从 daisy ui 导入对话框组件,但收到以下错误消息:
Unsafe member access .showModal on an `any` value.eslint@typescript-eslint/no-unsafe-member-access
Unsafe call of an `any` typed value.eslint@typescript-eslint/no-unsafe-call
Unsafe return of an `any` typed value.eslint@typescript-eslint/no-unsafe-return
Property 'my_modal_2' does not exist on type 'Window & typeof globalThis'.ts(2339)
Run Code Online (Sandbox Code Playgroud)
我没有篡改默认代码:
<button
className="btn"
onClick={() => window.my_modal_2.showModal()}
>
open modal
</button>
<dialog id="my_modal_2" className="modal">
<form method="dialog" className="modal-box">
<h3 className="text-lg font-bold">Hello!</h3>
<p className="py-4">Press ESC key or click outside to close</p>
</form>
<form method="dialog" className="modal-backdrop">
<button>close</button>
</form>
</dialog>
Run Code Online (Sandbox Code Playgroud)
有人知道发生了什么事吗?
我正在使用 shadcn 的react-hook-form,我已经设法导航文档以获取我需要的输入和选择,但我创建的 onSubmit 函数没有执行任何操作。
有谁知道为什么?
"use client";
import * as z from "zod";
import { SubmitHandler, useForm, UseFormRegister } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { Input } from "./ui/input";
import ErrorMessage from "./ErrorMessage";
import { Button } from "./ui/button";
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "./ui/Form";
import { Textarea } from "./ui/textarea";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import toast from "react-hot-toast";
type ReminderFormSchemaType = z.infer<typeof …Run Code Online (Sandbox Code Playgroud)