Skip to content

Commit

Permalink
fix(turbopack): print missing slots in debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Feb 20, 2024
1 parent 0c7cc02 commit e0ee152
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { notFound } from './not-found'

export const PARALLEL_ROUTE_DEFAULT_PATH =
'next/dist/client/components/parallel-route-default'
'next/dist/client/components/parallel-route-default.js'

export default function ParallelRouteDefault() {
notFound()
Expand Down
10 changes: 4 additions & 6 deletions packages/next/src/server/app-render/create-component-tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,7 @@ async function createComponentTreeInternal({
}
} else {
staticGenerationStore.dynamicShouldError = false
if (dynamic === 'force-static') {
staticGenerationStore.forceStatic = true
} else {
staticGenerationStore.forceStatic = false
}
staticGenerationStore.forceStatic = dynamic === 'force-static'
}
}

Expand Down Expand Up @@ -427,7 +423,9 @@ async function createComponentTreeInternal({
// When we detect the default fallback (which triggers a 404), we collect the missing slots
// to provide more helpful debug information during development mode.
const parsedTree = parseLoaderTree(parallelRoute)
if (parsedTree.layoutOrPagePath === PARALLEL_ROUTE_DEFAULT_PATH) {
if (
parsedTree.layoutOrPagePath?.endsWith(PARALLEL_ROUTE_DEFAULT_PATH)
) {
missingSlots.add(parallelRouteKey)
}
}
Expand Down
7 changes: 3 additions & 4 deletions test/turbopack-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4029,13 +4029,12 @@
},
"test/e2e/app-dir/parallel-route-not-found/parallel-route-not-found.test.ts": {
"passed": [
"parallel-route-not-found should handle a layout that attempts to render a missing parallel route",
"parallel-route-not-found should handle multiple missing parallel routes",
"parallel-route-not-found should not log any warnings for a regular not found page",
"parallel-route-not-found should render the page & slots if all parallel routes are found"
],
"failed": [
"parallel-route-not-found should handle a layout that attempts to render a missing parallel route",
"parallel-route-not-found should handle multiple missing parallel routes"
],
"failed": [],
"pending": [],
"flakey": [],
"runtimeError": false
Expand Down

0 comments on commit e0ee152

Please sign in to comment.