Skip to content

Commit c185c4b

Browse files
committed
Fix failure
1 parent 5f93b8e commit c185c4b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/next/src/build/webpack/loaders/next-app-loader/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ const nextAppLoader: AppLoader = async function nextAppLoader() {
835835
const [createdRootLayout, rootLayoutPath] = await verifyRootLayout({
836836
appDir: appDir,
837837
dir: rootDir!,
838-
tsconfigPath: tsconfigPath!,
838+
tsconfigPath: tsconfigPath,
839839
pagePath,
840840
pageExtensions,
841841
})

packages/next/src/lib/verify-root-layout.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export async function verifyRootLayout({
6363
}: {
6464
dir: string
6565
appDir: string
66-
tsconfigPath: string
66+
tsconfigPath: string | undefined
6767
pagePath: string
6868
pageExtensions: PageExtensions
6969
}): Promise<[boolean, string | undefined]> {
@@ -112,7 +112,8 @@ export async function verifyRootLayout({
112112
}
113113

114114
if (typeof availableDir === 'string') {
115-
const resolvedTsConfigPath = path.join(dir, tsconfigPath)
115+
const tsConfigFileName = tsconfigPath || 'tsconfig.json'
116+
const resolvedTsConfigPath = path.join(dir, tsConfigFileName)
116117
const hasTsConfig = await fs.access(resolvedTsConfigPath).then(
117118
() => true,
118119
() => false

0 commit comments

Comments
 (0)