mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
### Why? Some app-static prerendered not-found fixtures still fetched `https://next-data-api.vercel.app/api/random`, which now points at a different static deployment and returns 404 for the API route. The rest of the test suite uses `https://next-data-api-endpoint.vercel.app` for this shared data API. ### How? Updated the two stale fixture fetches to use `https://next-data-api-endpoint.vercel.app/api/random`. ### Verification - `rg "next-data-api\.vercel\.app" test` returned no matches - `git diff --check` passed for the changed files - Not run: full e2e suite (URL-only fixture change) - Not run: prettier/eslint (local `node_modules` is missing, so `prettier` and `eslint` were not available) <!-- NEXT_JS_LLM_PR -->
39 lines
675 B
TypeScript
39 lines
675 B
TypeScript
import React from 'react'
|
|
import { notFound } from 'next/navigation'
|
|
|
|
export function generateStaticParams() {
|
|
return [
|
|
{
|
|
slug: 'first',
|
|
},
|
|
{
|
|
slug: 'second',
|
|
},
|
|
]
|
|
}
|
|
|
|
export default async function Page(props: {
|
|
params: Promise<{ slug: string }>
|
|
}) {
|
|
const params = await props.params
|
|
await fetch('https://next-data-api-endpoint.vercel.app/api/random', {
|
|
next: {
|
|
tags: ['explicit-tag'],
|
|
},
|
|
})
|
|
|
|
if (
|
|
params.slug !== 'second' &&
|
|
process.env.NEXT_PHASE === 'phase-production-build'
|
|
) {
|
|
notFound()
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<p>/prerendered-not-found/{params.slug}</p>
|
|
<p>{Date.now()}</p>
|
|
</>
|
|
)
|
|
}
|