facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
116.89k stars 24.05k forks source link

iOS 17.x only SyntaxError: Invalid character: '\0' #41258

Open MAKARD opened 8 months ago

MAKARD commented 8 months ago

Description

Since iOS 17.x was released, our reporting system reports the crash SyntaxError: Invalid character: '\0'. The stack traces are different, so I gathered the most frequent:

at value(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Pressability/Pressability.js:778:event)
at value(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Pressability/Pressability.js:743:event)
at value(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Pressability/Pressability.js:701:prevState)
at onResponderGrant(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Pressability/Pressability.js:482:null)
at w(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:84:event)
at extractEvents(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:625:shouldSetEventType)
at Anonymous function(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1147:topLevelType)
at Pe(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:8457:a)
at Ce(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1106:fn)
at Le(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1137:batchedUpdates)
at receiveTouches(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1209:index$0)
at value(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:428:moduleMethods)
at Anonymous function(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:module)
at value(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:368:fn)
at value(/var/mobile/Containers/Data/Application/01518041-355A-40FC-8834-DD054A63E87E/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:__guard)
at value(/var/mobile/Containers/Data/Application/CDF015B5-699E-496F-9D2E-7573FB8FB5CC/Library/Application node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:113:registration)
at value(/var/mobile/Containers/Data/Application/CDF015B5-699E-496F-9D2E-7573FB8FB5CC/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:428:moduleMethods)
at Anonymous function(/var/mobile/Containers/Data/Application/CDF015B5-699E-496F-9D2E-7573FB8FB5CC/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:module)
at value(/var/mobile/Containers/Data/Application/CDF015B5-699E-496F-9D2E-7573FB8FB5CC/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:368:fn)
at value(/var/mobile/Containers/Data/Application/CDF015B5-699E-496F-9D2E-7573FB8FB5CC/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:__guard)
at mi(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:7282:root)
at ci(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:6975:root)
at pt(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:2145:callback)
at Pe(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:8462:flushSyncCallbacks)
at Ce(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1106:fn)
at Le(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1137:batchedUpdates)
at receiveTouches(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:1209:index$0)
at value(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:428:moduleMethods)
at Anonymous function(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:module)
at value(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:368:fn)
at value(/var/mobile/Containers/Data/Application/329C2409-10F1-4F5F-9130-9B15051DC69E/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:__guard)
at Anonymous function(/var/mobile/Containers/Data/Application/CC9E820C-5699-4F6A-8857-E8DBBDD6D094/Library/Application node_modules/react-native/Libraries/Core/Timers/JSTimers.js:213:apply)
at k(/var/mobile/Containers/Data/Application/CC9E820C-5699-4F6A-8857-E8DBBDD6D094/Library/Application node_modules/react-native/Libraries/Core/Timers/JSTimers.js:111:callback)
at callTimers(/var/mobile/Containers/Data/Application/CC9E820C-5699-4F6A-8857-E8DBBDD6D094/Library/Application node_modules/react-native/Libraries/Core/Timers/JSTimers.js:359:timersToCall)
at value(/var/mobile/Containers/Data/Application/CC9E820C-5699-4F6A-8857-E8DBBDD6D094/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:428:moduleMethods)
at Anonymous function(/var/mobile/Containers/Data/Application/CC9E820C-5699-4F6A-8857-E8DBBDD6D094/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:module)
at value(/var/mobile/Containers/Data/Application/CC9E820C-5699-4F6A-8857-E8DBBDD6D094/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:368:fn)
at value(/var/mobile/Containers/Data/Application/CC9E820C-5699-4F6A-8857-E8DBBDD6D094/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:__guard)
at ba(/var/mobile/Containers/Data/Application/CB82D7EC-E8D0-42E8-91B9-7654E225C810/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:6117:componentWillUnmount)
at va(/var/mobile/Containers/Data/Application/CB82D7EC-E8D0-42E8-91B9-7654E225C810/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:6007:finishedRoot)
at ba(/var/mobile/Containers/Data/Application/CB82D7EC-E8D0-42E8-91B9-7654E225C810/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:6122:finishedRoot)
at va(/var/mobile/Containers/Data/Application/CB82D7EC-E8D0-42E8-91B9-7654E225C810/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:6007:finishedRoot)
at ba(/var/mobile/Containers/Data/Application/CB82D7EC-E8D0-42E8-91B9-7654E225C810/Library/Application node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js:6105:finishedRoot)
at value(/var/mobile/Containers/Data/Application/B735A0AB-115F-49A0-8C3C-C00A22462795/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:428:moduleMethods)
at Anonymous function(/var/mobile/Containers/Data/Application/B735A0AB-115F-49A0-8C3C-C00A22462795/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:113:module)
at value(/var/mobile/Containers/Data/Application/B735A0AB-115F-49A0-8C3C-C00A22462795/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:368:fn)
at value(/var/mobile/Containers/Data/Application/B735A0AB-115F-49A0-8C3C-C00A22462795/Library/Application node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:112:__guard)

React Native Version

0.72.4

Output of npx react-native info

System: OS: macOS 14.0 CPU: (10) arm64 Apple M1 Pro Memory: 1.18 GB / 32.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 20.5.0 path: /opt/homebrew/bin/node Yarn: version: 1.22.17 path: /opt/homebrew/bin/yarn npm: version: 9.8.0 path: /opt/homebrew/bin/npm Watchman: Not Found Managers: CocoaPods: version: 1.12.1 path: /Users/user/.rbenv/shims/pod SDKs: iOS SDK: Platforms:

Steps to reproduce

There are no particular steps to reproduce. According to the reporting system, it happens on the app start or randomly within the user session. No specific user interactions were identified as the cause of the issue.

Snack, screenshot, or link to a repository

In this regard, I can only share the package.json:

{
    "name": "app",
    "version": "1.0.0",
    "private": true,
    "scripts": {
        "start": "APP_ENV=development npx react-native start"
    },
    "engines": {
        "node": "18.x.x"
    },
    "dependencies": {
        "@babel/core": "^7.22.10",
        "@babel/plugin-proposal-decorators": "^7.22.10",
        "@babel/runtime": "^7.22.10",
        "@bloomreach/react-sdk": "^22.0.2",
        "@bloomreach/spa-sdk": "^22.0.2",
        "@braze/react-native-sdk": "^6.0.2",
        "@contentsquare/react-native-bridge": "3.4.0",
        "@dynatrace/react-native-plugin": "^2.271.3",
        "@openspacelabs/react-native-zoomable-view": "^2.1.1",
        "@optimizely/react-sdk": "^2.9.2",
        "@react-native-async-storage/async-storage": "^1.19.2",
        "@react-native-clipboard/clipboard": "^1.11.2",
        "@react-native-community/datetimepicker": "^7.4.1",
        "@react-native-community/masked-view": "0.1.10",
        "@react-native-community/netinfo": "^9.4.1",
        "@react-native-cookies/cookies": "^6.2.1",
        "@react-native-firebase/analytics": "^18.3.0",
        "@react-native-firebase/app": "^18.3.0",
        "@react-native-firebase/dynamic-links": "^18.3.0",
        "@react-native-firebase/messaging": "^18.3.0",
        "@react-native-firebase/perf": "^18.3.0",
        "@react-native-firebase/remote-config": "^18.3.0",
        "@react-navigation/bottom-tabs": "^6.5.8",
        "@react-navigation/native": "^6.1.7",
        "@react-navigation/stack": "^6.3.17",
        "axios": "^1.4.0",
        "babel-plugin-add-react-displayname": "^0.0.5",
        "babel-plugin-module-resolver": "^5.0.0",
        "crypto": "^1.0.1",
        "html-entities": "^2.4.0",
        "i18next": "^23.4.4",
        "if-env": "^1.0.4",
        "metro-react-native-babel-preset": "0.77.0",
        "react": "18.2.0",
        "react-content-loader": "^6.2.1",
        "react-fast-compare": "^3.2.2",
        "react-i18next": "^13.1.2",
        "react-native": "0.72.4",
        "react-native-biometrics": "^3.0.1",
        "react-native-camera": "^4.2.1",
        "react-native-canvas": "^0.1.39",
        "react-native-circular-progress": "^1.3.9",
        "react-native-code-push": "^8.1.0",
        "react-native-device-info": "^10.8.0",
        "react-native-dotenv": "^3.4.9",
        "react-native-exit-app": "^2.0.0",
        "react-native-fast-image": "^8.6.3",
        "react-native-geolocation-service": "^5.3.1",
        "react-native-gesture-handler": "^2.12.1",
        "react-native-image-zoom-viewer": "^3.0.1",
        "react-native-inappbrowser-reborn": "^3.7.0",
        "react-native-keychain": "^8.1.2",
        "react-native-maps": "^1.7.1",
        "react-native-modal-datetime-picker": "^17.1.0",
        "react-native-permissions": "^3.9.2",
        "react-native-prompt-android": "^1.1.0",
        "react-native-rate": "^1.2.12",
        "react-native-ratings": "^8.1.0",
        "react-native-safe-area-context": "^4.7.1",
        "react-native-screens": "^3.24.0",
        "react-native-sha256": "^1.4.9",
        "react-native-snap-carousel": "^3.9.1",
        "react-native-splash-screen": "^3.3.0",
        "react-native-svg": "^13.12.0",
        "react-native-tracking-transparency": "^0.1.2",
        "react-native-url-polyfill": "^2.0.0",
        "react-native-uuid": "^2.0.1",
        "react-native-v8": "^2.2.2",
        "react-native-webview": "^13.3.1",
        "react-qr-code": "^2.0.12",
        "react-redux": "^8.1.2",
        "redux": "^4.2.1",
        "rn-android-keyboard-adjust": "^2.1.2",
        "tealium-react-native": "^2.3.1",
        "typescript": "^5.1.6",
        "urbanairship-react-native": "^14.7.0",
        "v8-android-jit-nointl": "^11.1000.4"
    },
    "devDependencies": {
        "@react-native-community/eslint-config": "^3.2.0",
        "@react-native/eslint-config": "^0.72.2",
        "@react-native/metro-config": "^0.72.11",
        "@testing-library/jest-native": "^5.4.2",
        "@testing-library/react-hooks": "^8.0.1",
        "@testing-library/react-native": "^12.2.2",
        "@tsconfig/react-native": "^3.0.2",
        "@types/jest": "^29.5.3",
        "@types/react": "^18.2.20",
        "@types/react-native": "^0.72.2",
        "@types/react-native-canvas": "^0.1.9",
        "@types/react-native-snap-carousel": "^3.8.5",
        "@types/react-test-renderer": "^18.0.0",
        "@types/redux-watch": "^1.1.0",
        "@typescript-eslint/eslint-plugin": "^6.4.1",
        "@typescript-eslint/parser": "^6.4.1",
        "@typescript-eslint/utils": "^6.4.1",
        "babel-jest": "29.6.3",
        "commitizen": "^4.3.0",
        "cspell": "^7.0.1",
        "cz-format-extension": "^1.5.1",
        "eslint": "^8.47.0",
        "eslint-config-airbnb-typescript": "17.1.0",
        "eslint-import-resolver-typescript": "^3.6.0",
        "eslint-plugin-import": "2.28.1",
        "eslint-plugin-jest": "^27.2.3",
        "eslint-plugin-jsx-a11y": "6.7.1",
        "eslint-plugin-react": "^7.33.2",
        "eslint-plugin-react-hooks": "4.6.0",
        "husky": "^8.0.3",
        "jest": "29.6.3",
        "jest-fail-on-console": "^3.1.1",
        "jest-junit": "^16.0.0",
        "jest-transform-stub": "^2.0.0",
        "npm-check-updates": "^16.12.3",
        "react-test-renderer": "18.2.0",
        "release-it": "^16.1.5"
    },
    "resolutions": {
        "nanoid": "^3.3.2",
        "node-fetch": "^2.6.7",
        "json-schema": "^0.4.0",
        "simple-plist": "^1.3.1",
        "shell-quote": "^1.7.3",
        "formidable": "^3.2.4",
        "prompts": "^2.4.2",
        "minimist": "^1.2.6",
        "set-value": "^4.1.0"
    },
    "config": {
        "commitizen": {
            "path": "cz-format-extension"
        }
    }
}
github-actions[bot] commented 8 months ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
github-actions[bot] commented 8 months ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.72.6. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
GeoffZhu commented 8 months ago

I have encountered the same issue, and it seems to be at the communication layer(C++).

MAKARD commented 7 months ago

Found a similar report on Apple forum https://developer.apple.com/forums/thread/739234?login=true&page=1#772141022

Jorgezz commented 7 months ago

It must be a problem caused by iOS 17 upgrade.

Lakston commented 4 months ago

Same issue here, still happens with RN 0.72.X and iOS 17.3.X

BrandonCao commented 4 months ago

I'm getting this as well. Any updates here?

WaSheepM commented 1 month ago

wait for fix