You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(storage-resize-images): kit/extension parity – invalid IMG_SIZES or SHARP_OPTIONS deploy, then every upload fails #3265
storage-resize-images kit/extension parity. Priority: high. A bad value deploys cleanly, then every upload fails without an error-level log.
Difference
Extension:IMG_SIZES and SHARP_OPTIONS are validated at install, and a value that passes the pattern but isn't valid JSON fails when the function loads.
Kit: the patterns apply only to the install prompt. A value already in .env is not checked at deploy, and SHARP_OPTIONS is first parsed on the first upload.
Reproduced
.env value
Extension
Kit
IMG_SIZES=200x (also x200, abc)
Rejected: Invalid sizes, must be a comma-separated list of WIDTHxHEIGHT values.
Deploy complete!; every upload logs Error when resizing image Error: Expected positive integer between 1 and 100000000 for height but received NaN and writes nothing
SHARP_OPTIONS={bad}
Instance goes to ERRORED: Could not load the function
Deploys; every upload is dropped with an unlabelled SyntaxError that doesn't name the param
Validate IMG_SIZES, SHARP_OPTIONS and OUTPUT_OPTIONS at load, as validatePathListsFromEnv() does, so a bad value fails the deploy naming the param. In the README, say to quote JSON values in .env.
Activity
storage-resize-imageskit tracking issue #3263