Skip to content
Discussion options

You must be logged in to vote

Hey @christophemenager, I think you meant 3.56, are you sure this worked in 3.55? Because when I copy paste:

import config from "@payload-config";
import { getPayload } from "payload";

const main = () => {
  const payload = await getPayload({ config }); // No error but the script exists at this step
}

It has an error - await without async and you don't actually execute the main function`

You need to rewrite it like this:

import config from '@payload-config'
import { getPayload } from 'payload'

const main = async () => {
  const payload = await getPayload({ config })
}

await main()

One change that could be related is in this PR #13564 which adds auto process exit for bin scripts which …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@christophemenager
Comment options

Answer selected by r1tsuu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #13969 on September 30, 2025 09:10.