Repository navigation
Description
Describe the Bug
Hello dear community! :)
For some reason, out of the blue, whenever I try to run generate:types the process hangs and it never ends, with no exit code whatsoever. Eventually it generates the types, yes, but the process doesn't finish at all. Same with generate:importmap.
However, whenever I run pnpm dev and Payload starts, the types are generated without any problem! The problem arises whenever I try to run the command directly.
Looking at the code base, specifically at payload/packages/payload/src/bin/index.ts around lines 97-197 I found this:
if (script.startsWith('migrate')) {
return migrate({ config, parsedArgs: args }).then(() => process.exit(0))
}
if (script === 'generate:types') {
return generateTypes(config)
}
if (script === 'generate:importmap') {
return generateImportMap(config)
}While migrate has a process.exit the others don't.
I can't possibly debug what might be wrong with my installation of Payload if the commands don't exit with any error or if the errors are not being handled :(
Thank you for looking into this!
Link to the code that reproduces this issue
Reproduction Steps
I can't reproduce the issue. I made a fresh installation of Payload and generate:types works fine, I'm not sure what's wrong with my installation, it stopped working out of the blue, but whatever it is, I'm not getting any error and certainly something might be happening that prevents from finishing the operation and that exception is not being handled. — i.e: I have generate:types in a CI pipeline at github and the whole Workflow hangs because the process can't exit, not even to say "error".
Which area(s) are affected? (Select all that apply)
area: core
Environment Info
Binaries:
Node: 22.14.0
npm: 10.9.2
Yarn: 1.22.22
pnpm: 10.12.4
Relevant Packages:
payload: 3.54.0
next: 15.3.0
@payloadcms/db-postgres: 3.54.0
@payloadcms/email-resend: 3.54.0
@payloadcms/graphql: 3.54.0
@payloadcms/next/utilities: 3.54.0
@payloadcms/plugin-cloud-storage: 3.54.0
@payloadcms/plugin-multi-tenant: 3.54.0
@payloadcms/richtext-lexical: 3.54.0
@payloadcms/storage-uploadthing: 3.54.0
@payloadcms/translations: 3.54.0
@payloadcms/ui/shared: 3.54.0
react: 19.0.0
react-dom: 19.0.0
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 8
Activity
github-actions commentedon Sep 8, 2025
Please add a reproduction in order for us to be able to investigate.
Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.
Why was this issue marked with the
invalid-reproductionlabel?To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with
create-payload-app@latest -t blankor a forked/branched version of this repository with tests added (more info in the reproduction-guide).To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.
Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.
I added a link, why was it still marked?
Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.
Useful Resources
juanpablob commentedon Sep 8, 2025
I'm sorry that I could not provide a link for reproducing the error, because I simply cannot reproduce the error because I literally have no information about what's going on if the process doesn't show any error, if that makes sense? I can't debug if no information is given. Thank you!
andershermansen commentedon Sep 15, 2025
I also have this issue in one of my projects. I have also been unable to pinpoint what actually causes it.
lsofshows no obvious open files, and trying to attach a node process debugger also did not reveal anything for me.I created a PR to just exit the process as has been done for jobs before. Hope payload team will accept it.
andershermansen commentedon Sep 15, 2025
Should be fixed by #13564
DanRibbens commentedon Sep 19, 2025
Can somebody verify this has been fixed by v3.56.0?
andershermansen commentedon Sep 19, 2025
@DanRibbens Yes, the project I had with same issue had this fixed with 3.56.0.
AlessioGr commentedon Sep 19, 2025
Fixed by #13564
github-actions commentedon Sep 27, 2025
This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.