Unverified Commit afbb5636 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Fix trace when initial file is also child (#30048)

* Fix trace when initial file is also child

* update page count test
parent b794c171
......@@ -327,7 +327,11 @@ export class TraceEntryPointsPlugin implements webpack.Plugin {
for (const file of fileList!) {
const reason = reasons!.get(file)
if (!reason || reason.type === 'initial' || !reason.parents) {
if (
!reason ||
!reason.parents ||
(reason.type === 'initial' && reason.parents.size === 0)
) {
continue
}
propagateToParents(reason.parents, file)
......
import Link from 'next/link'
import Error from 'next/error'
export default function Page(props) {
return (
<>
<Error title="something went wrong (on purpose)" />
<Link href="/">
<a>to home</a>
</Link>
</>
)
}
......@@ -58,7 +58,7 @@ describe('Production Usage', () => {
})
it('should contain generated page count in output', async () => {
const pageCount = 39
const pageCount = 40
expect(output).toContain(`Generating static pages (0/${pageCount})`)
expect(output).toContain(
`Generating static pages (${pageCount}/${pageCount})`
......@@ -79,6 +79,22 @@ describe('Production Usage', () => {
],
notTests: [/node_modules\/react\/cjs\/react\.development\.js/],
},
{
page: '/client-error',
tests: [
/webpack-runtime\.js/,
/chunks\/.*?\.js/,
/node_modules\/react\/index\.js/,
/node_modules\/react\/package\.json/,
/node_modules\/react\/cjs\/react\.production\.min\.js/,
/next\/link\.js/,
/next\/dist\/client\/link\.js/,
/next\/dist\/shared\/lib\/router\/utils\/resolve-rewrites\.js/,
/next\/dist\/pages\/_error\.js/,
/next\/error\.js/,
],
notTests: [/node_modules\/react\/cjs\/react\.development\.js/],
},
{
page: '/dynamic',
tests: [
......@@ -110,6 +126,8 @@ describe('Production Usage', () => {
notTests: [
/node_modules\/react\/cjs\/react\.development\.js/,
/node_modules\/nanoid\/index\.cjs/,
/next\/dist\/pages\/_error\.js/,
/next\/error\.js/,
],
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment