-
Notifications
You must be signed in to change notification settings - Fork 577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReferenceError when trying to PutObject
to S3 from React Native
#6204
Comments
Hi @g-popovic - thanks for reaching out. I recalled looking into the other issue mentioned, and interesting part is that this's only reproducible with Android? Do you mind adding this middleware stack to your code and share the requests from the output? That will give us some insight on the issue. s3Client.middlewareStack.add(next => async (args) => {
console.log(args.request)
const response = await next(args);
console.log(response);
return next(args);
}, {step: 'finalizeRequest'}) For your reference, I found this old issue that might be worth taking a peek at. I would also suggest reaching out to React Native related repo that might get you unblocked if there are similar issues reported like the one linked above. Best, |
Thanks for the prompt response. Yes indeed, and on Android emulator. On iOS and iOS Simulator it runs without problem for me. After adding the middleware you provided and trying to upload a CSV file, this is the log I saw in the console:
I notice that the response was not logged however, only the request, guess it must've errored out. Let me know if you need any other info from me that would help you with the debugging of this. |
Hey @aBurmeseDev, have there been any updates on this? |
@g-popovic - apologies for the delay. I don't see anything unusual from SDK request that you shared and it should be working as expected. I'm also looking into React Native side. Will keep it posted here. Which NodeJS version are you running? |
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Checkboxes for prior research
Describe the bug
When trying to execute a
PutObject
command to S3 withContentEncoding: "gzip"
, we get the errorReferenceError: Property 'e' doesn't exist
and the upload fails. This only happens on Android, iOS doesn't have this problem. This so far only happens whenContentEncoding
is set togzip
- it works when it's undefined or set tobase64
for example.EDIT: after some further debugging into the lib code itself, we discovered that the actual error seems to be the following (tldr:
SignatureDoesNotMatch
):It looks like the library doesn't handle errors correctly, resulting in a very undescriptive and difficult to debug error.
The
SignatureDoesNotMatch
error does seem to be potentially related to this already existing issue.SDK version number
@aws-sdk/client-s3@3.598.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
react-native@0.72.12
Reproduction Steps
On an android device/emulator:
Observed Behavior
The file doesn't get uploaded to S3 and
ReferenceError: Property 'e' doesn't exist
gets thrown, with no further information or visible stack trace.Expected Behavior
The gzipped file should get properly uploaded to S3, and/or the error should be more descriptive and provide more useful information.
Possible Solution
No response
Additional Information/Context
Note that the suggested polyfills have been imported:
I have also attempted to upload this gzipped file using
Upload
from@aws-sdk/lib-storage
, however the same error was still being thrown.NOTE: I have seen a similar-looking issue. However that is about a different service, so it seems it could be a separate issue.
The text was updated successfully, but these errors were encountered: