Comments (10)
I have the exact same issue on Payload 3.0.0-beta.43
and Sharp 0.33.4
.
If I do not specify the height at all, I get:
ERROR: FileUploadError: There was a problem while uploading the file. at generateFileData (webpack-internal:///(rsc)/./node_modules/payload/dist/uploads/generateFileData.js:232:15)
If I specify the height as any number or undefined
, I get:
ERROR: ValidationError: media validation failed: sizes.image.height: Cast to Number failed for value "NaN" (type number) at path "height" at Document.invalidate (/node_modules/mongoose/lib/document.js:3177:32)
For me the suggested maxOffsetY
fix did not work.
from payload.
@kirillminiaev Of course:
@todor0v your error seems to be related more to your database: MongoDB. It's as if the database model expects there to be a "height" value for your resizing and when a NaN
value is passed, the internal Model validation kicks in and spews the error. So in your case, I would think either a height is required
(and the Payload team needs to address a workaround) or code needs to ensure that a NaN
is not passed to the model. Ultimately, it could be that whatever data is passed to the Next create.js:20:17
line needs to be pre-processed to validate the height
parameter. At least that is where I would start my debugging process if I were you.
from payload.
Fairly certain this is the fix #6729
Let's verify in the next 2.x release.
from payload.
I have the exact same issue on Payload
3.0.0-beta.43
and Sharp0.33.4
.If I do not specify the height at all, I get:
ERROR: FileUploadError: There was a problem while uploading the file. at generateFileData (webpack-internal:///(rsc)/./node_modules/payload/dist/uploads/generateFileData.js:232:15)
If I specify the height as any number or
undefined
, I get:ERROR: ValidationError: media validation failed: sizes.image.height: Cast to Number failed for value "NaN" (type number) at path "height"
For me the suggested
maxOffsetY
fix did not work.
@todor0v can you post a full error stack-trace. Seems you may need to adjust the code pertaining to the specific Cast to Number failed for value "NaN" (type number) at path "height"
error for a fix for your version of Payload.
from payload.
@kirillminiaev Of course:
from payload.
Fairly certain this is the fix #6729
Let's verify in the next 2.x release.
@denolfe thank you. Looking forward to the next release with the fix implemented.
from payload.
@PatrikKozak, just upgraded to 2.20.0 and the issues persists. Not sure if you were planning to push the fix with this next release. My original fix patched the issue in 2.20.0
from payload.
Hey @kirillminiaev
I have a fix for the issue here.
V3 fix is here
We'll get these merged either today or tomorrow!
from payload.
Thank you @PatrikKozak!
from payload.
This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.
from payload.
Related Issues (20)
- Migration unable to run (Postgresql) HOT 3
- plugin-sentry: build fails with the Payload v2.28.0
- Write conflict error when deleting a document in afterChange hook HOT 4
- Unable to save content with umlauts in localized fields within a Global configuration HOT 3
- FieldLabel has incorrect props HOT 2
- Bug in @payloadcms/richtext-slate when upgrading to Payload 2.28.0 related to faceless-ui/modal
- Lexical custom block in new document (beta 108 regression) HOT 8
- Autosave makes it impossible to create new (localized) documents HOT 2
- create-payload-app creates project with duplicate graphql versions HOT 1
- delete operation doesn't return deleted id HOT 2
- Join Field: Incorrect Parent Relationship Assignment When Adding a New Document HOT 1
- Row Field > alignment issue HOT 3
- Radio Group's name is not convert to snake-case format in PostgreSQL
- plugin-cloud expiring S3 credentials
- Fields contained in row field inside localized group don't get saved
- Label function for document view tab does not apply selected language translation correctly HOT 2
- Potential deadlock on concurrent updates
- Index on related fields not being created in database (Postgres) HOT 5
- Error: input image exeeds pixel limit when uploading through localAPI
- payload-locked-documents error on every CMS client action HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from payload.