payloadcms / payloadcms/payload
"MissingFile: No files were uploaded" error is raised when using payload.create to upload an image when imageSizes is enabled.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
Describe the Bug
I've written a seeder script to insert db records. It can be found in the context of a minimum example here:
https://github.com/wspsycle/payload-cms-upload-error/blob/main/src/seed/works/seed-works.ts
Running yarn run seed, the script gets called. The script calls payload.create to upload an image and create a record. Previously it worked. However, since adding upload.imageSizes to my Works model, now when I run yarn run seed, I see an error about the image file not existing, when it does exist:
Seeding...
Seeding works...
[✓] Pulling schema from database...
[16:03:53] WARN: No email adapter provided. Email will be written to console. More info at https://payloadcms.com/docs/email/overview.
Seeding work "Acme Co. Website"...
Uploading file "beach.jpg" to "/Users/mac1/Desktop/upload-test/src/seed/works/beach.jpg"
/Users/mac1/Desktop/upload-test/node_modules/payload/src/uploads/generateFileData.ts:154
throw new MissingFile(req.t)
^
MissingFile: No files were uploaded.
at generateFileData (/Users/mac1/Desktop/upload-test/node_modules/payload/src/uploads/generateFileData.ts:154:13)
at createOperation (/Users/mac1/Desktop/upload-test/node_modules/payload/src/collections/operations/create.ts:162:63)
at async seedWork (/Users/mac1/Desktop/upload-test/src/seed/works/seed-works.ts:41:16)
at async seedWorks (/Users/mac1/Desktop/upload-test/src/seed/works/seed-works.ts:61:3)
at async seed (/Users/mac1/Desktop/upload-test/src/seed/seed.ts:5:3) {
data: null,
isOperational: true,
isPublic: true,
status: 400,
[cause]: null
}
Node.js v22.15.0
The expectation I have is that payload.create continues to work even when upload.imageSizes is enabled.
Link to the code that reproduces this issue
https://github.com/wspsycle/payload-cms-upload-error
Reproduction Steps
- Install dependencies with
yarn - Run seed script with
yarn run seed - See error
MissingFile: No files were uploaded.
Which area(s) are affected?
Not sure, area: core
Environment Info
Binaries:
Node: 22.15.0
npm: 10.9.2
Yarn: 1.22.21
pnpm: N/A
Relevant Packages:
payload: 3.84.1
next: 16.2.3
@payloadcms/db-sqlite: 3.84.1
@payloadcms/drizzle: 3.84.1
@payloadcms/graphql: 3.84.1
@payloadcms/next/utilities: 3.84.1
@payloadcms/richtext-lexical: 3.84.1
@payloadcms/translations: 3.84.1
@payloadcms/ui/shared: 3.84.1
react: 19.2.4
react-dom: 19.2.4
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:03 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8112
Available memory (MB): 16384
Available CPU cores: 8
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported stack trace in src/uploads/generateFileData.ts and the create operation in src/collections/operations/create.ts, then compare them with the reproduction in src/seed/works/seed-works.ts. Run yarn run seed against the linked minimum example and verify that payload.create can upload the image when upload.imageSizes is enabled without raising MissingFile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100