豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit d836946

Browse files
committed
Guard export fallback variant paths
1 parent ad26827 commit d836946

File tree

11 files changed

+96
-1
lines changed

11 files changed

+96
-1
lines changed

packages/next/src/export/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ async function exportAppImpl(
11861186

11871187
await Promise.all(
11881188
manifestEntries.map(({ fallbackPath, orig }) =>
1189-
emitFallbackArtifacts(fallbackPath, orig, false)
1189+
emitFallbackArtifacts(fallbackPath, orig, true)
11901190
)
11911191
)
11921192
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Suspense } from 'react'
2+
import DocsCatchAllClient from './slug-client'
3+
4+
export default function DocsCatchAllPage() {
5+
return (
6+
<main>
7+
<Suspense fallback={<h1>Loading docs catch-all...</h1>}>
8+
<DocsCatchAllClient />
9+
</Suspense>
10+
</main>
11+
)
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use client'
2+
3+
import { useParams } from 'next/navigation'
4+
5+
export default function DocsCatchAllClient() {
6+
const { slug } = useParams()
7+
return <h1>{`catchall:${slug.join('/')}`}</h1>
8+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Suspense } from 'react'
2+
import DocsSectionPageClient from './params-client'
3+
4+
export function generateStaticParams() {
5+
return [{ section: 'api', page: 'reference' }]
6+
}
7+
8+
export default function DocsSectionPage() {
9+
return (
10+
<main>
11+
<Suspense fallback={<h1>Loading docs section page...</h1>}>
12+
<DocsSectionPageClient />
13+
</Suspense>
14+
</main>
15+
)
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use client'
2+
3+
import { useParams } from 'next/navigation'
4+
5+
export default function DocsSectionPageClient() {
6+
const { section, page } = useParams()
7+
return <h1>{`${section}:${page}`}</h1>
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function DocsPage() {
2+
return <p>docs</p>
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function RootLayout({ children }) {
2+
return (
3+
<html>
4+
<body>{children}</body>
5+
</html>
6+
)
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function Page() {
2+
return <p>home</p>
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @type {import('next').NextConfig}
3+
*/
4+
const nextConfig = {
5+
output: 'export',
6+
cacheComponents: true,
7+
}
8+
9+
module.exports = nextConfig
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
reserved fallback variant path

0 commit comments

Comments
 (0)