Skip to content
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

[RangeError: Property storage exceeds 196607 properties] when fetch PUT a 84KB jpg file #334

Open
emclab opened this issue Feb 12, 2024 · 1 comment

Comments

@emclab
Copy link

emclab commented Feb 12, 2024

In react native 0.70.x app, the following code is used to upload a jpg image to OSS storage with a pre signed URL:

import ReactNativeBlobUtil from 'react-native-blob-util';  //dependency. v0.19.2
uploadToOSS : async (preSignedUrl, filePath, extension, filename) => {   //filename, 23200/fxxxxx-xxxxxx.jpg, is used as object key for OSS
   var fileData;
   try {
     if (!preSignedUrl || !filePath || !contentTypeMap[extension]) return false;

     fileData = await ReactNativeBlobUtil.fs.readFile(filePath, 'base64');
   
     const response = await ReactNativeBlobUtil.fetch('PUT', preSignedUrl, fileData);  <<==throw exceed range error for a 84KB jpg image

     console.log("respnose in uploadtooss : ", response);
     if (response.ok) {  //fetch successful
       return true;
     } else {
       return false;
     };
   } catch (err) {
     console.log("upload to OSS failed : ", err);
     return false;
   };

},

  • please provide the version of installed library and RN project: RN: 0.70.x RN blob util:0.19.2.
@RonRadtke
Copy link
Owner

does that happen every time? And please try the newest version. I'm wondering if that has to do with some dirty buffers that got fixed already.

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

No branches or pull requests

2 participants