Minimal reproduction based on create-payload-app -t blank (Payload 3.90.2, SQLite).
The only change from the template is in tsconfig.json:
- removed the
"@payload-config"entry fromcompilerOptions.paths - added
"rootDir": "./"
pnpm install
pnpm payload generate:typesExpected: types are generated (the config at src/payload.config.ts is found by the src/ fallback), or an error saying the config cannot be found.
Actual: the command prints nothing and never exits. The node .../payload/bin.js generate:types process sits at 100% CPU (one core) until killed.
getTSConfigPaths() in packages/payload/src/config/find.ts uses compilerOptions.rootDir as srcPath without resolving it:
const srcPath = tsConfig.compilerOptions?.rootDir || path.resolve(process.cwd(), 'src')findConfig() then calls findUpSync({ dir: './', ... }). Since path.parse('./').root === '' and path.dirname('.') === '.', dir never equals root, and the while (true) loop in findUpSync never ends.
Either of these avoids the loop:
cp .env.example .env
PAYLOAD_CONFIG_PATH=src/payload.config.ts pnpm payload generate:typesor add "@payload-config": ["./src/payload.config.ts"] back to compilerOptions.paths.
Note: removing @payload-config also breaks the Next.js app imports; that's expected for this repro, which only targets the CLI.