I have a problem with Next.JS's not-found.tsx (using /app)
Here's the error:
Error: Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `unstable_setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components#static-rendering at /vercel/path0/.next/server/chunks/8008.js:20:5350 at /vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:185493 at l (/vercel/path0/.next/server/chunks/8008.js:20:5818) at /vercel/path0/.next/server/chunks/8008.js:20:4732 at /vercel/path0/.next/server/chunks/8008.js:20:4735 at s (/vercel/path0/.next/server/chunks/8008.js:20:5096) at w (/vercel/path0/.next/server/chunks/4326.js:1:9329) at eh (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:134786) at e (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:137671) at ek (/vercel/path0/node_modules/next/dist/compiled/next-server/app-page.runtime.prod.js:12:138145) ✓ Generating static pages (5/5)> Export encountered errors on following paths: /_not-found/page: /_not-foundMy not-found.tsx (at the root of /app)
import React from "react"import Link from "next/link"import { Button, Card, CardBody, CardFooter } from "@nextui-org/react"
export default function NotFound() { return ( <div className="flex min-h-screen items-center justify-center"> <Card className="w-full max-w-md rounded-[25px] p-6 shadow-lg"> <CardBody> <h2 className="mb-2 text-center text-3xl font-extrabold"> Not Found </h2> <h3 className="text-center">Could not find requested resource</h3> </CardBody> <CardFooter> <div className="flex justify-center align-middle"> <Link href="/" className="mx-2"> <Button className="bg-[#00699e]">Return Home</Button> </Link> <Link href="https://...." className="mx-2"> <Button className="bg-[#fff] text-[#000]">Discord</Button> </Link> <Link href="https://...." className="mx-2"> <Button className="bg-[#eb2626]">Twitter / X</Button> </Link> </div> </CardFooter> </Card> </div> )}
You should also know that in “npm run dev”, it works fine, but as soon as I put it into production (via vercel), I get the error above.
I also use [locale]/ folder, for next-intl
I try the documentation (https://nextjs.org/docs/app/api-reference/file-conventions/not-found)