Closed
Description
When a React Native app is placed in debug mode, syntax errors break iOS emulators, which requires the iOS emulator to be force closed. Rather than serving the broken code to the emulator, if the React Native project is using Typescript, use Typescript's tsc --noEmit
to type check first and print errors to console and do not compile and send to the iOS emulator.
React Native version:
React Native Environment Info:
System:
OS: macOS 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Memory: 39.07 MB / 16.00 GB
Shell: 3.0.2 - /usr/local/bin/fish
Binaries:
Node: 12.4.0 - /usr/local/bin/node
Yarn: yarn install v0.21.3
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.42s. - /usr/local/bin/yarn
npm: 6.10.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 26, 27
Build Tools: 27.0.3, 28.0.0
System Images: android-26 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 3.1 AI-173.4720617
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-34.0.1.tar.gz => 0.59.8
npmGlobalPackages:
eslint-plugin-react-native: 3.2.1
react-native-cli: 2.0.1
Steps To Reproduce
- Place a Typescript React Native app in debug mode
- Use iOS Emulator to serve the app
- If there is a syntax error, the emulator will crash.
Describe what you expected to happen:
I would expect that the app is type checked prior to compiling, and errors are thrown in console, compilation is stopped, and my emulator will not crash and require a force-close.