diff --git a/packages/next/server/next-typescript.ts b/packages/next/server/next-typescript.ts index db244af381deb..8f134cd3e1031 100644 --- a/packages/next/server/next-typescript.ts +++ b/packages/next/server/next-typescript.ts @@ -9,6 +9,7 @@ */ import path from 'path' +import { findDir } from '../lib/find-pages-dir' const DISALLOWED_SERVER_REACT_APIS: string[] = [ 'useState', @@ -193,7 +194,7 @@ export function createTSPlugin(modules: { } function create(info: ts.server.PluginCreateInfo) { - const appDir = path.join(info.project.getCurrentDirectory(), 'app') + const appDir = findDir(info.project.getCurrentDirectory(), 'app') ?? path.join(info.project.getCurrentDirectory(), 'app') const isAppEntryFile = (filePath: string) => { return ( filePath.startsWith(appDir) &&