摘要: # Next.js 14 // src/app/api/product/route.ts import prisma from '@/prisma/prisma' import type { NextApiRequest, NextApiResponse } from 'next' // GET / 阅读全文
posted @ 2025-01-05 16:10 sekihin 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 我们需要更新 UserProfile.tsx 组件,改用 Next.js 的 Link 组件而不是 react-router-dom 的 Link 组件。以下是解决方法: 这样可以确保组件更好地适应 Next.js 的框架,避免不兼容的问题。 # 错误的代码 'use client' import 阅读全文
posted @ 2025-01-05 10:32 sekihin 阅读(26) 评论(0) 推荐(0) 编辑
摘要: Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error Error: Attempted to call generateViewport() from the 阅读全文
posted @ 2025-01-05 10:22 sekihin 阅读(35) 评论(0) 推荐(0) 编辑
摘要: 开发 Next.js 项目遇到报错: [cause]: TypeError: e_.createContext is not a function 出现这个报错的原因是在 Next.js 项目中,在 Server Component 中使用了MUI组件,但是MUI组件没有做 SSR 适配就会导致这个 阅读全文
posted @ 2025-01-05 08:44 sekihin 阅读(17) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示