Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Cannot read property 'split' of undefined #72

Open
codeghees opened this issue Mar 28, 2020 · 3 comments
Open

Cannot read property 'split' of undefined #72

codeghees opened this issue Mar 28, 2020 · 3 comments

Comments

@codeghees
Copy link

codeghees commented Mar 28, 2020

My code: following the documentation to the dot. Can't figure out what the error is.
function ImageSubmit(event){ console.log(event.target.files[0]) let file = event.target.files[0].name S3Client.uploadFile(file) .then(data => console.log("X", data)) .catch(err => console.error(err)) }
My error:

index.js:1 TypeError: Cannot read property 'split' of undefined
at s.uploadFile (aws-s3.js:1)
at ImageSubmit (AddCarPage.js:72)
at HTMLUnknownElement.callCallback (react-dom.development.js:336)
at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
at invokeGuardedCallback (react-dom.development.js:440)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:454)
at executeDispatch (react-dom.development.js:584)
at executeDispatchesInOrder (react-dom.development.js:609)
at executeDispatchesAndRelease (react-dom.development.js:713)
at executeDispatchesAndReleaseTopLevel (react-dom.development.js:722)
at forEachAccumulated (react-dom.development.js:694)
at runEventsInBatch (react-dom.development.js:739)
at runExtractedPluginEventsInBatch (react-dom.development.js:880)
at handleTopLevel (react-dom.development.js:5803)
at batchedEventUpdates$1 (react-dom.development.js:24401)
at batchedEventUpdates (react-dom.development.js:1415)
at dispatchEventForPluginEventSystem (react-dom.development.js:5894)
at attemptToDispatchEvent (react-dom.development.js:6010)
at dispatchEvent (react-dom.development.js:5914)

@sarykemmoun2
Copy link

@codeghees I have this issue too.
Did you solve it?

@codeghees
Copy link
Author

Yeah - I was sending just the name - send the entire object.
@sarykemmoun2

@danirabbani90
Copy link

can you please help me solving this as well ? i am getting the same error cannot read property split of undefined

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants