acostalima / react-native-polyfill-globals

Polyfills and patches missing or partially supported web and core APIs.
MIT License
45 stars 4 forks source link

typeerror: Streaming request bodies is not supported, js engine: hermes #11

Open AkbarBakhshi opened 6 months ago

AkbarBakhshi commented 6 months ago

I just upgraded from Expo 47 to 50 and as part of upgrade, made proper changes to enable Hermes JS engine. I am using expo-dev-client to create development builds and so, in my Podfile.properties.json I have the following code now:

{
  "expo.jsEngine": "hermes",
  "EX_DEV_CLIENT_NETWORK_INSPECTOR": "true"
}

Similarly in my gradle.properties, I now have this:

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

You can see a list of all the changes here: https://docs.expo.dev/bare/upgrade/?fromSdk=47&toSdk=50

With these changes made, now I am getting the error mentioned in the title of this issue:

typeerror: Streaming request bodies is not supported, js engine: hermes

I have installed react-native-polyfill-globals and all the dependencies as you see in my package.json file below:

{
  "name": "xfit",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "start": "expo start --dev-client",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web"
  },
  "dependencies": {
    "@expo-google-fonts/rubik": "^0.2.2",
    "@flyerhq/react-native-link-preview": "^1.6.0",
    "@gorhom/bottom-sheet": "^4",
    "@gorhom/portal": "^1.0.14",
    "@react-native-async-storage/async-storage": "1.21.0",
    "@react-native-community/datetimepicker": "7.7.0",
    "@react-native-firebase/app": "19.2.2",
    "@react-native-firebase/app-check": "19.2.2",
    "@react-native-firebase/auth": "19.2.2",
    "@react-native-firebase/firestore": "19.2.2",
    "@react-native-firebase/functions": "19.2.2",
    "@react-native-firebase/storage": "19.2.2",
    "@react-native-material/core": "^1.3.7",
    "@react-navigation/bottom-tabs": "^6.5.2",
    "@react-navigation/drawer": "^6.6.2",
    "@react-navigation/material-top-tabs": "^6.5.1",
    "@react-navigation/native": "^6.1.1",
    "@react-navigation/native-stack": "^6.9.7",
    "@react-navigation/stack": "^6.3.10",
    "@reduxjs/toolkit": "^1.9.1",
    "@rneui/base": "^4.0.0-rc.7",
    "@rneui/themed": "^4.0.0-rc.7",
    "@sanity/client": "^4.0.1",
    "@sanity/image-url": "^1.0.2",
    "axios": "^1.2.6",
    "base-64": "^1.0.0",
    "dayjs": "^1.11.7",
    "expo": "~50.0.17",
    "expo-application": "~5.8.4",
    "expo-av": "~13.10.6",
    "expo-build-properties": "~0.11.1",
    "expo-clipboard": "~5.0.1",
    "expo-dev-client": "~3.3.12",
    "expo-device": "~5.9.4",
    "expo-font": "~11.10.3",
    "expo-haptics": "~12.8.1",
    "expo-image-picker": "~14.7.1",
    "expo-keep-awake": "~12.8.2",
    "expo-linear-gradient": "~12.7.2",
    "expo-linking": "~6.2.2",
    "expo-notifications": "~0.27.7",
    "expo-screen-orientation": "~6.4.1",
    "expo-splash-screen": "~0.26.5",
    "expo-status-bar": "~1.11.1",
    "expo-store-review": "~6.8.3",
    "expo-updates": "~0.24.13",
    "lottie-ios": "4.3.3",
    "lottie-react-native": "6.5.1",
    "nativewind": "^2.0.11",
    "react": "18.2.0",
    "react-native": "0.73.6",
    "react-native-animatable": "^1.3.3",
    "react-native-calendars": "^1.1293.0",
    "react-native-chart-kit": "^6.12.0",
    "react-native-circular-progress": "^1.3.8",
    "react-native-circular-progress-indicator": "^4.4.2",
    "react-native-confetti-cannon": "^1.5.2",
    "react-native-controlled-mentions": "^2.2.5",
    "react-native-countdown-circle-timer": "^3.2.1",
    "react-native-dropdown-picker": "^5.4.6",
    "react-native-fetch-api": "^3.0.0",
    "react-native-gesture-handler": "~2.14.0",
    "react-native-get-random-values": "1.11.0",
    "react-native-gifted-charts": "^1.2.42",
    "react-native-gifted-chat": "^2.0.1",
    "react-native-image-crop-picker": "0.38.1",
    "react-native-image-zoom-viewer": "^3.0.1",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-linear-gradient": "^2.6.2",
    "react-native-pager-view": "6.2.3",
    "react-native-polyfill-globals": "^3.1.0",
    "react-native-progress": "^5.0.0",
    "react-native-reanimated": "~3.6.2",
    "react-native-reanimated-carousel": "^3.3.0",
    "react-native-safe-area-context": "4.8.2",
    "react-native-screens": "~3.29.0",
    "react-native-shared-element": "0.8.8",
    "react-native-square-in-app-payments": "^1.7.3",
    "react-native-svg": "14.1.0",
    "react-native-swiper": "^1.6.0",
    "react-native-tab-view": "^3.3.4",
    "react-native-timer-picker": "^1.5.3",
    "react-native-toast-message": "^2.1.5",
    "react-native-url-polyfill": "^2.0.0",
    "react-native-uuid": "^2.0.1",
    "react-native-walkthrough-tooltip": "^1.6.0",
    "react-native-webview": "13.6.4",
    "react-native-youtube-iframe": "^2.2.2",
    "react-navigation-shared-element": "^3.1.3",
    "react-redux": "^8.0.5",
    "text-encoding": "^0.7.0",
    "web-streams-polyfill": "3.3.3"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "react-native-dotenv": "^3.4.7",
    "react-native-svg-transformer": "^1.0.0",
    "tailwindcss": "3.3.2"
  },
  "private": true
}

I have added import 'react-native-polyfill-globals/auto'; to my App.js file as well. When I remove it, application builds successfully, but streaming doesn't work. Then as soon as I add it, I see the error below: IMG_83F901B50285-1

Screenshot 2024-05-27 at 9 40 56 AM

The whole thing was working fine with Expo47 which used jsc engine, but now is crashing with Hermes. I am using the pollyfill to allow streaming with my fetch requests.

Any idea how this can be fixed?

Zakisb commented 5 months ago

ANY UPDATE???? I M FACING SAME ISSUES HERE

mcraig1978 commented 5 months ago

Any updates? I too am facing same issues