Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(next): global not-found not working on multi-root layouts" #64601

Merged
merged 2 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/next/src/build/webpack/loaders/next-app-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,9 @@ async function createTreeCodeFromPath(

const isDefaultNotFound = isAppBuiltinNotFoundPage(pagePath)
const appDirPrefix = isDefaultNotFound ? APP_DIR_ALIAS : splittedPath[0]
const rootNotFound = await resolver(
const hasRootNotFound = await resolver(
`${appDirPrefix}/${FILE_TYPES['not-found']}`
)
const hasRootNotFound = Boolean(rootNotFound)
const pages: string[] = []

let rootLayout: string | undefined
Expand Down Expand Up @@ -383,8 +382,7 @@ async function createTreeCodeFromPath(
)?.[1]
rootLayout = layoutPath

const isRootNotFound = hasRootNotFound && isRootLayer && isNotFoundRoute
if ((isRootNotFound || isDefaultNotFound) && !layoutPath) {
if (isDefaultNotFound && !layoutPath && !rootLayout) {
rootLayout = defaultLayoutPath
definedFilePaths.push(['layout', rootLayout])
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions test/e2e/app-dir/not-found/multi-root-layout/index.test.ts

This file was deleted.

12 changes: 0 additions & 12 deletions test/turbopack-build-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2164,18 +2164,6 @@
"flakey": [],
"runtimeError": false
},
"test/e2e/app-dir/not-found/multi-root-layout/index.test.ts": {
"passed": [
"not-found-multi-root-layout should render main not-found",
"not-found-multi-root-layout should render sub not-found"
],
"failed": [
"not-found-multi-root-layout should render root not-found for uncaught routes"
],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/e2e/app-dir/pages-to-app-routing/pages-to-app-routing.test.ts": {
"passed": ["pages-to-app-routing should work using browser"],
"failed": [],
Expand Down
9 changes: 0 additions & 9 deletions test/turbopack-dev-tests-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1531,15 +1531,6 @@
"flakey": [],
"runtimeError": false
},
"test/development/app-dir/root-not-found-missing-root-layout/index.test.ts": {
"passed": [],
"failed": [
"root-not-found-missing-root-layout should not conflict with generated layout on dev server"
],
"pending": [],
"flakey": [],
"runtimeError": false
},
"test/development/app-dir/strict-mode-enabled-by-default/strict-mode-enabled-by-default.test.ts": {
"passed": ["Strict Mode enabled by default should work using browser"],
"failed": [],
Expand Down