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.

Getting many flow errors in version 0.5.3 and RN 0.60

See original GitHub issue

Bug report

Summary

Flow throws about 60 errors related to this package. Is this expected? Maybe it’s due to the fact that your flow config is not up to date?

An extract from the error logs:

$ flow --show-all-errors .
Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:11:26

Property __extends is missing in global object [1].

      8β”‚  * @format
      9β”‚  */
     10β”‚ 'use strict';
 [1] 11β”‚ var __extends = (this && this.__extends) || (function () {
     12β”‚     var extendStatics = function (d, b) {
     13β”‚         extendStatics = Object.setPrototypeOf ||
     14β”‚             ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:14:27

Cannot use empty array literal [1] as a prototype. Expected an object or null.

     11β”‚ var __extends = (this && this.__extends) || (function () {
     12β”‚     var extendStatics = function (d, b) {
     13β”‚         extendStatics = Object.setPrototypeOf ||
 [1] 14β”‚             ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
     15β”‚             function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
     16β”‚         return extendStatics(d, b);
     17β”‚     };


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:14:70

Mutating this prototype is unsupported.

     11β”‚ var __extends = (this && this.__extends) || (function () {
     12β”‚     var extendStatics = function (d, b) {
     13β”‚         extendStatics = Object.setPrototypeOf ||
     14β”‚             ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
     15β”‚             function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
     16β”‚         return extendStatics(d, b);
     17β”‚     };


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:24:25

Property __assign is missing in global object [1].

 [1] 11β”‚ var __extends = (this && this.__extends) || (function () {
       :
     21β”‚         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
     22β”‚     };
     23β”‚ })();
     24β”‚ var __assign = (this && this.__assign) || function () {
     25β”‚     __assign = Object.assign || function(t) {
     26β”‚         for (var s, i = 1, n = arguments.length; i < n; i++) {
     27β”‚             s = arguments[i];


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:33:33

A spread argument is unsupported here.

     30β”‚         }
     31β”‚         return t;
     32β”‚     };
     33β”‚     return __assign.apply(this, arguments);
     34β”‚ };
     35β”‚ var __rest = (this && this.__rest) || function (s, e) {
     36β”‚     var t = {};


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:35:23

Property __rest is missing in global object [1].

 [1] 11β”‚ var __extends = (this && this.__extends) || (function () {
       :
     32β”‚     };
     33β”‚     return __assign.apply(this, arguments);
     34β”‚ };
     35β”‚ var __rest = (this && this.__rest) || function (s, e) {
     36β”‚     var t = {};
     37β”‚     for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
     38β”‚         t[p] = s[p];


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:42:19

Cannot assign computed property using Symbol [1].

     node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js
     39β”‚     if (s != null && typeof Object.getOwnPropertySymbols === "function")
     40β”‚         for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
     41β”‚             if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
     42β”‚                 t[p[i]] = s[p[i]];
     43β”‚         }
     44β”‚     return t;
     45β”‚ };

     /private/tmp/flow/flowlib_37553ac1/core.js
 [1] 55β”‚     static getOwnPropertySymbols(o: mixed): Symbol[];


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:46:32

Property __importDefault is missing in global object [1].

 [1] 11β”‚ var __extends = (this && this.__extends) || (function () {
       :
     43β”‚         }
     44β”‚     return t;
     45β”‚ };
     46β”‚ var __importDefault = (this && this.__importDefault) || function (mod) {
     47β”‚     return (mod && mod.__esModule) ? mod : { "default": mod };
     48β”‚ };
     49β”‚ Object.defineProperty(exports, "__esModule", { value: true });


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:50:20

Cannot call __importDefault because:
 β€’ property __importDefault of unknown type [1] is not a function.
 β€’ a call signature declaring the expected parameter / return type is missing in global object [2].

 [1] 46β”‚ var __importDefault = (this && this.__importDefault) || function (mod) {
     47β”‚     return (mod && mod.__esModule) ? mod : { "default": mod };
     48β”‚ };
     49β”‚ Object.defineProperty(exports, "__esModule", { value: true });
 [2] 50β”‚ var nullthrows_1 = __importDefault(require("nullthrows"));
     51β”‚ var react_1 = __importDefault(require("react"));
     52β”‚ var react_native_1 = require("react-native");
     53β”‚ var IOSCheckBoxNativeComponent_1 = __importDefault(require("./IOSCheckBoxNativeComponent"));


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:51:15

Cannot call __importDefault because:
 β€’ property __importDefault of unknown type [1] is not a function.
 β€’ a call signature declaring the expected parameter / return type is missing in global object [2].

 [1] 46β”‚ var __importDefault = (this && this.__importDefault) || function (mod) {
     47β”‚     return (mod && mod.__esModule) ? mod : { "default": mod };
     48β”‚ };
     49β”‚ Object.defineProperty(exports, "__esModule", { value: true });
     50β”‚ var nullthrows_1 = __importDefault(require("nullthrows"));
 [2] 51β”‚ var react_1 = __importDefault(require("react"));
     52β”‚ var react_native_1 = require("react-native");
     53β”‚ var IOSCheckBoxNativeComponent_1 = __importDefault(require("./IOSCheckBoxNativeComponent"));
     54β”‚ // @ts-ignore setAndForwardRef type does not exist in @types/react-native


Error β”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆβ”ˆ node_modules/@react-native-community/checkbox/dist/CheckBox.ios.js:53:36

Cannot call __importDefault because:
 β€’ property __importDefault of unknown type [1] is not a function.
 β€’ a call signature declaring the expected parameter / return type is missing in global object [2].

 [1] 46β”‚ var __importDefault = (this && this.__importDefault) || function (mod) {
     47β”‚     return (mod && mod.__esModule) ? mod : { "default": mod };
     48β”‚ };
     49β”‚ Object.defineProperty(exports, "__esModule", { value: true });
     50β”‚ var nullthrows_1 = __importDefault(require("nullthrows"));
     51β”‚ var react_1 = __importDefault(require("react"));
     52β”‚ var react_native_1 = require("react-native");
 [2] 53β”‚ var IOSCheckBoxNativeComponent_1 = __importDefault(require("./IOSCheckBoxNativeComponent"));
     54β”‚ // @ts-ignore setAndForwardRef type does not exist in @types/react-native
     55β”‚ var setAndForwardRef_1 = __importDefault(require("react-native/Libraries/Utilities/setAndForwardRef"));
     56β”‚ var CheckBox = /** @class */ (function (_super) {

...

Environment info

react-native info output:

System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
    Memory: 189.59 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.14.2 - ~/.nvm/versions/node/v10.14.2/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v10.14.2/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 27, 28, 29
      Build Tools: 27.0.3, 28.0.3, 29.0.2, 29.0.3
      System Images: android-21 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
      Android NDK: 21.0.6113669
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6392135
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.8.6 => 16.8.6
    react-native: 0.60.0 => 0.60.0
  npmGlobalPackages:
    react-native-cli: 2.0.1

Library version: 0.5.3

Steps to reproduce

  1. Setup a RN 0.60 project (haven’t tested on newer versions)
  2. Install this package and optionally add a checkbox component somewhere
  3. yarn flow

Describe what you expected to happen:

No flow errors should appear.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
nicholaslee119commented, Sep 23, 2020

RN 0.60 was only supported by Checkbox 0.3 Please use the 0.3 for RN 0.60

0reactions
v-almonacidcommented, Oct 17, 2020

@nicholaslee119 feel free to close the issue. I cannot confirm the fix since I’m not using this package (for now).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Newly initialized react native project has flow errors #11655
Description The long and short of it is, I'm getting flow errors on brand new projects created with the react native cli (version...
Read more >
ryanwu/rn-fetch-blob
rn -fetch-blob version 0.10.16 is only compatible with react native 0.60 and up. It should have been a major version bump, we apologize...
Read more >
Estimated errors in magnetic cloud model fit parameters with ...
This paper briefly reviews our earlier study done on estimated errors in various output fit parameters resulting from a specific force-free interplanetaryΒ ...
Read more >
AP Physics 2 – Practice Workbook – Book 2 ….
This book is a compilation of all the problems published by College Board in AP. Physics B and AP Physics C that were...
Read more >
Statistics and Probability for Engineering Applications
Although the various versions of Excel all contain tools for performing ... What is the probability of getting one heads and one tails?...
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