Hi,
I'm having an error after editing a field (not the files field) and cannot Save the item.
This is the error:
TypeError: Cannot read properties of undefined (reading 'data')
at getFilesToUpload (./node_modules/payload-s3-upload/dist/buildUploadHook.js:23:29)
at ./node_modules/payload-s3-upload/dist/buildUploadHook.js:40:23
"data" referred in the error, is the actual upload file.
I believe the reason for the error, is that upon editing and saving (for example the "author" of the item) there is not an actual file being uploaded, so this hook should be completely skipped.
To reproduce the bug:
Create an upload collection with a field for "name" - { name: "name", type: "text"}
Create an item though the CMS interface (upload a file, set a name - "test1")
Modify the name to "test2" and save
Error: Cannot read properties of undefined (reading 'data')
Hi, I'm having an error after editing a field (not the files field) and cannot Save the item.
This is the error: TypeError: Cannot read properties of undefined (reading 'data') at getFilesToUpload (./node_modules/payload-s3-upload/dist/buildUploadHook.js:23:29) at ./node_modules/payload-s3-upload/dist/buildUploadHook.js:40:23
"data" referred in the error, is the actual upload file.
I believe the reason for the error, is that upon editing and saving (for example the "author" of the item) there is not an actual file being uploaded, so this hook should be completely skipped.
To reproduce the bug:
Hope this helps Nir