LightningFlowComponents
LightningFlowComponents copied to clipboard
File Upload Improved - Upload Screen Component - Error Thrown on Upload
FileUploadsImproved appears to be broken in my Summer '22 Patch 13.3 Salesforce Sandbox. The error thrown upon uploading a file looks like it points to the key parameter on line 33 of fileUploadImproved.html. I might be wrong about that!
Interestingly, this is not a problem for me in Production, which is on Summer '22 Patch 13.
Steps to reproduce
Steps to reproduce the behavior:
- Install version 1.8.2 of the FileUploadImproved package into a Salesforce Sandbox with version Summer '22 Patch 13.3
- Add the File Upload Improved component to a flow screen
- Run or debug flow, uploading a file to the component
- Allow upload to complete; close progress screen
- See error
Note that when debugging, the error is logged in the console, but not displayed. Regardless, the list item is not displayed on the flow screen.
Expected behaviour
Uploaded file should be displayed above or below upload field (depending on options set on component).
Actual behaviour
Error is thrown, and no file is displayed.
Screenshots
Please excuse the blurring; none of it is relevant, I promise! Blurred to ensure my company is ok with it :)
With Lightning Debugging on, this is the line referenced in the stack trace.
Debug Logs
Debug log captured from Javascript Console in web browser.
Console Error Statement
Uncaught (in promise) Error: Invalid key value "[object Object]" in [object:vm FileUpload (44)]. Key must be a string or number.
at Object.fail (aura_proddebug.js:5105:13)
at k (aura_proddebug.js:9363:26)
at eval (fileUploadImproved.js:197:16)
at i (aura_proddebug.js:9259:25)
at tmpl (fileUploadImproved.js:194:375)
at aura_proddebug.js:9881:29
at ReactiveObserver.observe (aura_proddebug.js:5817:15)
at isUpdatingTemplate (aura_proddebug.js:9837:15)
at runWithBoundaryProtection (aura_proddebug.js:10696:7)
at evaluateTemplate (aura_proddebug.js:9830:7)
I'm having this same issue - I'm not sure if that's a useful contribution!
Hey all, thanks for pointing this out. This is a bug the key in line 33 of html needs to be switched to {objFile.contentVersionId}. I'll eventually get around to updating the source, but if you want to make the change and confirm that works, that would be helpful!
Thanks for the fix, Ben! It's in new version 1.8.3 at https://unofficialsf.com/from-josh-dayment-improved-file-upload-in-flow-screens/
Thanks @BenJenkin! I've been meaning to do this. So appreciate you taking the reigns.