Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Repro: payload generate:types hangs forever with a relative rootDir

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 from compilerOptions.paths
  • added "rootDir": "./"

Steps

pnpm install
pnpm payload generate:types

Expected: 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.

Cause

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.

Workaround

Either of these avoids the loop:

cp .env.example .env
PAYLOAD_CONFIG_PATH=src/payload.config.ts pnpm payload generate:types

or 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages