Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
e8c8546c
Unverified
Commit
e8c8546c
authored
Jul 09, 2025
by
Hendrik Liebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a failing test
parent
893d59f9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
0 deletions
+91
-0
page.tsx
...e/app-dir/sub-shell-generation/app/[lang]/[slug]/page.tsx
+13
-0
layout.tsx
test/e2e/app-dir/sub-shell-generation/app/[lang]/layout.tsx
+31
-0
layout.tsx
test/e2e/app-dir/sub-shell-generation/app/layout.tsx
+9
-0
next.config.js
test/e2e/app-dir/sub-shell-generation/next.config.js
+10
-0
sub-shell-generation.test.ts
...app-dir/sub-shell-generation/sub-shell-generation.test.ts
+28
-0
No files found.
test/e2e/app-dir/sub-shell-generation/app/[lang]/[slug]/page.tsx
0 → 100644
View file @
e8c8546c
export
default
async
function
Page
({
params
,
}:
{
params
:
Promise
<
{
lang
:
string
;
slug
:
string
}
>
})
{
const
{
slug
}
=
await
params
return
<
p
>
slug:
{
slug
}
</
p
>
}
export
function
generateStaticParams
({
params
}:
{
params
:
{
lang
:
string
}
})
{
return
params
.
lang
===
'fr'
?
[{
slug
:
'1'
}]
:
[]
}
test/e2e/app-dir/sub-shell-generation/app/[lang]/layout.tsx
0 → 100644
View file @
e8c8546c
import
{
ReactNode
}
from
'react'
import
{
setTimeout
}
from
'timers/promises'
export
default
async
function
LangLayout
({
children
,
params
,
}:
{
children
:
ReactNode
params
:
Promise
<
{
lang
:
string
}
>
})
{
const
{
lang
}
=
await
params
if
(
lang
===
'en'
)
{
// Simulate uncached I/O. This should lead to a build-time error, because we
// expect a fallback shell to be generated for /en/[slug]. It would be a
// prerender error at runtime if we tried to generate a route shell at
// runtime for /en/foo instead.
await
setTimeout
(
100
)
}
return
(
<>
<
h1
>
lang:
{
lang
}
</
h1
>
<
main
>
{
children
}
</
main
>
</>
)
}
export
function
generateStaticParams
()
{
return
[{
lang
:
'en'
},
{
lang
:
'fr'
}]
}
test/e2e/app-dir/sub-shell-generation/app/layout.tsx
0 → 100644
View file @
e8c8546c
import
{
ReactNode
}
from
'react'
export
default
function
Root
({
children
}:
{
children
:
ReactNode
})
{
return
(
<
html
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
test/e2e/app-dir/sub-shell-generation/next.config.js
0 → 100644
View file @
e8c8546c
/**
* @type {import('next').NextConfig}
*/
const
nextConfig
=
{
experimental
:
{
dynamicIO
:
true
,
},
}
module
.
exports
=
nextConfig
test/e2e/app-dir/sub-shell-generation/sub-shell-generation.test.ts
0 → 100644
View file @
e8c8546c
import
{
isNextDev
,
nextTestSetup
}
from
'e2e-utils'
describe
(
'sub-shell-generation'
,
()
=>
{
const
{
next
,
isNextStart
}
=
nextTestSetup
({
files
:
__dirname
,
skipStart
:
!
isNextDev
,
})
if
(
isNextStart
)
{
it
(
'should fail with a validation error at build time'
,
async
()
=>
{
await
expect
(
next
.
build
()).
toReject
()
})
}
it
(
'should not fail when requesting /en/foo'
,
async
()
=>
{
if
(
isNextStart
)
{
try
{
await
next
.
start
()
}
catch
{
// Ignoring for now, until the build actually fails, in which case this
// whole test will be obsolete, and the test above will be sufficient.
}
}
const
res
=
await
next
.
fetch
(
'/en/foo'
)
expect
(
res
.
status
).
toBe
(
200
)
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment