fields-media-multipart: every image upload fails with "view.u16be is not a function" on image-size 2.2.0 and later
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- backend, full-stack
Research direction
Start in the media multipart field package and trace getImageMetadata and its direct imports of image-size/types/*; compare their calls with the public imageSize(input) entry point described in the issue. Check the package manifest and upload tests. Done when uploads across the listed formats store image metadata with the supported image-size version range, and regression coverage passes.
Written by the indexing model from the issue text.
Description
Steps to reproduce
- In a project on the published packages (
@keystone-6/core9.0.0,@keystone-6/fields-media-multipart1.0.0), withexamples/assets-local'sPostlist, run a freshnpm install. npm resolvesimage-size2.3.0, the latest release within the field's^2.0.0range.
The examples in this repository don't show it: pnpm-lock.yaml pins image-size 2.0.2, which predates the change.
2. npm run dev, then create a Post with any image in banner, from the Admin UI or with a GraphQL multipart upload.
Every upload fails, whatever the format (JPEG, PNG, WebP, GIF):
An error occurred while resolving input fields.
- Post.banner: view.u16be is not a function
With "overrides": { "image-size": "2.1.0" } the same uploads are stored.
| image-size | result |
|---|---|
| 2.1.0 | stored |
| 2.2.0 (2026-11-26) | view.u16be is not a function |
| 2.3.0 (2026-11-30) | view.u16be is not a function |
Expected
The image is stored, with its width, height and extension, as with image-size 2.1.0.
Cause
The field calls image-size's per-format modules directly with the upload's bytes:
import { JPG } from 'image-size/types/jpg'
// PNG, WEBP and GIF likewise
function getImageMetadata(bytes) {
for (const [type, checker] of types) {
if (checker.validate(bytes)) {
const result = checker.calculate(bytes)
Up to 2.1.0 those functions took a Uint8Array. Since 2.2.0 they take image-size's own View (a DataView subclass, dist/*/types/view.js):
validate: (view) => view.u16be(0) === 0xffd8,
A Uint8Array has no u16be. The public entry point is unaffected: imageSize(input) builds the View itself and returns width, height and type.
Until the field is fixed, narrowing its image-size range to >=2.0.3 <2.2.0 would stop new installs from breaking and keep the fix for CVE-2025-71329 and CVE-2025-71330 (#10079 still proposes 2.0.3).
Context
- Node 24.18.0, macOS;
@keystone-6/core9.0.0,@keystone-6/fields-media-multipart1.0.0,graphql-upload17.1.0.
- Dominant language
- TypeScript
- Stars
- 10k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 38
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from keystonejs/keystone
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
keystonejs/keystone#10143 ·
Maintainers usually reply within 1 day
-
[bug] List view search field becomes disabled when search returns no results, interrupting IME inputPossibly taken @ltxhhz claimed this 17 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
keystonejs/keystone#10097 ·
Maintainers usually reply within 1 day
-
Document Fields Demo page of docs refers to form that doesn't existMay be free again @Mthize claimed this 189 days ago, and no pull request is open. Open
Difficulty 1/5 Under an hour Newbie friendliness 72/100
keystonejs/keystone#9766 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 75/100
keystonejs/keystone#10142 ·
Maintainers usually reply within 1 day
-
bigInt field defaultValue { kind: 'autoincrement' } triggers missing value validationMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
keystonejs/keystone#10048 ·
Maintainers usually reply within 1 day
All issues in keystonejs/keystone
Similar issues
-
Media browser returns "Not found" for repositories using the SHA-256 object formatPossibly taken @adamchodera claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Follow-ups from #312Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
janhesters/remixcn#318 ·
Maintainers usually reply within 1 day
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
danielmiessler/LifeOS#3150 ·
Maintainers usually reply within 5 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Make the "%" unit spacing the same in the web and in A10Possibly taken @kragent66-glitch claimed this today. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comment ·