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
d7a94319
Commit
d7a94319
authored
Nov 22, 2025
by
Zack Tanner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
failing test for circular references
parent
22cc5be0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
0 deletions
+72
-0
client.tsx
...pp-dir/circular-reference-client-component/app/client.tsx
+10
-0
layout.tsx
...pp-dir/circular-reference-client-component/app/layout.tsx
+8
-0
page.tsx
...ir/circular-reference-client-component/app/other/page.tsx
+9
-0
page.tsx
.../app-dir/circular-reference-client-component/app/page.tsx
+23
-0
circular-reference-client-component.test.ts
...ent-component/circular-reference-client-component.test.ts
+16
-0
next.config.js
...pp-dir/circular-reference-client-component/next.config.js
+6
-0
No files found.
test/production/app-dir/circular-reference-client-component/app/client.tsx
0 → 100644
View file @
d7a94319
'use client'
export
default
function
ClientComp
({
data
}:
{
data
:
{
title
:
string
}
})
{
return
(
<
pre
>
<
div
>
Hello World
</
div
>
{
data
.
title
}
</
pre
>
)
}
test/production/app-dir/circular-reference-client-component/app/layout.tsx
0 → 100644
View file @
d7a94319
import
{
ReactNode
}
from
'react'
export
default
function
Root
({
children
}:
{
children
:
ReactNode
})
{
return
(
<
html
>
<
body
>
{
children
}
</
body
>
</
html
>
)
}
test/production/app-dir/circular-reference-client-component/app/other/page.tsx
0 → 100644
View file @
d7a94319
import
Link
from
'next/link'
export
default
function
Page
()
{
return
(
<
p
>
other page
<
Link
href=
"/"
>
home
</
Link
>
</
p
>
)
}
test/production/app-dir/circular-reference-client-component/app/page.tsx
0 → 100644
View file @
d7a94319
import
ClientComp
from
'./client'
export
default
async
function
Page
()
{
const
topic
=
{
title
:
'Topic'
,
fields
:
{
featured
:
[]
}
}
const
guide
=
{
title
:
'Guide'
,
fields
:
{
topic
:
[
topic
]
}
}
const
featured
=
{
title
:
'Featured'
,
fields
:
{
content
:
[
guide
],
topic
,
// points back to the same topic
},
}
// Circular reference: topic -> featured[] -> content[] -> topic
topic
.
fields
.
featured
.
push
(
featured
)
return
(
<
div
>
<
ClientComp
data=
{
topic
}
/>
Other
</
div
>
)
}
test/production/app-dir/circular-reference-client-component/circular-reference-client-component.test.ts
0 → 100644
View file @
d7a94319
import
{
nextTestSetup
}
from
'e2e-utils'
describe
(
'circular-reference-client-component'
,
()
=>
{
const
{
next
}
=
nextTestSetup
({
files
:
__dirname
,
env
:
{
NEXT_DEBUG_BUILD
:
'1'
,
},
})
it
(
'should not have errors when collecting segment data for a page with a circular reference to a client component'
,
async
()
=>
{
expect
(
next
.
cliOutput
).
not
.
toContain
(
'Error: Route / errored during segment collection'
)
})
})
test/production/app-dir/circular-reference-client-component/next.config.js
0 → 100644
View file @
d7a94319
/**
* @type {import('next').NextConfig}
*/
const
nextConfig
=
{}
module
.
exports
=
nextConfig
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