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

When in debug mode, use Typescript to type-check prior to compilation. #26351

Closed
shamilovtim opened this issue Sep 6, 2019 · 0 comments
Closed
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@shamilovtim
Copy link
Contributor

shamilovtim commented Sep 6, 2019

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

  1. Place a Typescript React Native app in debug mode
  2. Use iOS Emulator to serve the app
  3. 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.

@shamilovtim shamilovtim added the Bug label Sep 6, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Oct 4, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants