facebook / facebook/hermes

Property storage exceeds 196607 properties when sending a file via fetch()

Open
#1,394 6 comments 0 reactions 0 assignees View on GitHub
need more info
Dominant language
JavaScript
Stars
11.3k
Forks
859
Avg merge
1h 30m
Merged PRs (30d)
3

Description

## Bug Description

In my app I am using fetch to upload a file to a server. The server accepts the data in the same format as a HTML form would send it. I am using FormData to prepare the data. The error occurs when sending the data. This happens with axios, fetch and XMLHttpRequest. (probably because it's all the same)

### Using XMLHttpRequest
![image](https://github.com/facebook/hermes/assets/43087936/3062201f-6889-4b75-b0ba-aa397590d349)
![image](https://github.com/facebook/hermes/assets/43087936/26b3fdfb-cc42-45a4-af6c-5e5c6e2c06b0)

### Using axios
![image](https://github.com/facebook/hermes/assets/43087936/b763fb30-d326-43be-bd53-a8243f648ac8)
![image](https://github.com/facebook/hermes/assets/43087936/7c4fb360-af61-43b3-9807-0ddcb6ab84bd)

- [x] I have run `gradle clean` and confirmed this bug does not occur with JSC
- [x] The issue is reproducible with the latest version of React Native.

Hermes git revision (if applicable): -
React Native version: 0.74.1
OS: Host: Linux, Phone: Android 12
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): x86_64 (emulator)

## Steps To Reproduce

1. Create a ~2MB Uint8Array (for example a binary for OTA updating a MCU)
2. Add it to a FormData instance
3. Make a request

code example:
### axios
```ts
const uploadOTA = async (data: Uint8Array) => {
const formData = new FormData();
formData.append('firmware', data);

const axiosOptions = {
url: 'http://localhost:3000/', // test server
method: 'POST',
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
},
};

const res = await axios(axiosOptions);

return res.status === 200;
};

uploadOTA(data); // In my code, this data is the result of a fetch request that is downloading a binary from github releases
```

### fetch
```ts
const uploadOTA = async (data: Uint8Array) => {
const formData = new FormData();
formData.append('firmware', data);

const fetchOptions: RequestInit = {
method: 'POST',
body: formData,
headers: new Headers({
'Content-Type': 'multipart/form-data',
}),
};

const res = await fetch('http://localhost:3000/', fetchOptions);

return res.status === 200;
};

uploadOTA(data); // In my code, this data is the result of a fetch request that is downloading a binary from github releases
```

## The Expected Behavior
No crash, file uploading.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the axios, fetch, or XMLHttpRequest FormData upload with a roughly 2MB Uint8Array on React Native 0.74.1, Android 12 x86_64, using Hermes and then JSC for comparison. The issue mentions no source file or test entry point; done means the request uploads the file without the “Property storage exceeds 196607 properties” error or a crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.