question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[iOS] RCTAssert RCTFormatError 165 ReferenceError: Can't find variable: typeAnnotation

See original GitHub issue

Description

[iOS] app is working fine on simulator or device when I run it directly, But when I generate an archive it’s crashing. With the help of Crashlytics, I found the issue here

Fatal Exception: RCTFatalException: Unhandled JS Exception: ReferenceError: Can't find variable: typeAnnotation
Unhandled JS Exception: ReferenceError: Can't find variable: typeAnnotation, stack: <unknown>@1383:17088 v@2:1473 <unknown>@1382:425 v@2:1473 <unknown>@1381:339 v@2:1473 <unknown>@1374:6338 v@2:1473 <unknown>@1373:303 v@2:1473 <unknown>@650:7881 v@2:1473 <unknown>@437:237 v@2:1473 <unknown>@408:255 v@2:1473 <unknown>@6:57 v@2:1473 d@2:875 global code@1711:3
RCTAssert.m - Line 165
RCTFormatError + 165

React Native version:

System:
    OS: macOS 11.0.1
    CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
    Memory: 21.23 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
    Android SDK:
      API Levels: 23, 26, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2
      System Images: android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.2/12B45b - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_275 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.3 => 0.63.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Screen Shot 2021-01-19 at 6 34 07 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

19reactions
AliRehman7141commented, Jan 27, 2021

@mustymustafa check the auto imported thing

It is fixed by adding import 'react-native-gesture-handler'; to the index.js

Secondly, I removed an auto imported thing from babel which is causing the crash.

  • removed this import { cloneDeep } from '@babel/types';

Auto import from babel is the main crash.

15reactions
prvaghelacommented, Feb 3, 2021

I have removed one import in one of my JS having from ‘@babel/types’. Now it is working fine

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - react-native [iOS] RCTAssert RCTFormatError 165 ...
Fatal Exception: RCTFatalException: Unhandled JS Exception: ReferenceError: Can't find variable: typeAnnotation Unhandled JS Exception: ...
Read more >
React-Native [Ios] Rctassert Rctformaterror 165 Referenceerror
[iOS] app is working fine on simulator or device when I run it directly But JS Exception: ReferenceError: Can't find variable: typeAnnotation. mygulamali...
Read more >
react-native-macos | experimental fork for writing desktop apps
react-native [iOS] RCTAssert RCTFormatError 165 ReferenceError: Can't find variable: typeAnnotation. React-Native assets not loading - errors not clear.
Read more >
response-native [iOS] RCTAssert RCTFormatError 165 ...
Fatal Exception: RCTFatalException: Unhandled JS Exception: ReferenceError: Can't find variable: typeAnnotation Unhandled JS Exception: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found