react-native-general-calendars icon indicating copy to clipboard operation
react-native-general-calendars copied to clipboard

Unexpected reserved type string

Open ghorbani-m opened this issue 4 years ago • 10 comments

I upgraded to react-native 0.59.10 but bundling is failed:

`react-native-common\src\components\SegmentedControl.js: Unexpected reserved type string (20:30)

18 | static propTypes: { 19 | values: PropTypes.array,

20 | selectionColor: PropTypes.string, | ^ 21 | selectedIndex: PropTypes.number, 22 | onChange: PropTypes.func, 23 | titleStyle: PropTypes.any, at Object.raise (@react-native-community\cli\node_modules\metro-react-native-babel-transformer\node_modules@babel\parser\lib\index.js:7012:17)`

ghorbani-m avatar Dec 21 '19 06:12 ghorbani-m

@ghorbani-m I tried decoupling the projects an failed. Will try again in the weekend.

rghorbani avatar Dec 23 '19 07:12 rghorbani

I am having this error also. It is when I upgraded my RN version from 0.59.9 to 0.61.5

nicolaselorr avatar Feb 10 '20 03:02 nicolaselorr

I installed https://www.npmjs.com/package/patch-package. I tried to edit the file to a working one. Then, run the command yarn patch-package react-native-common. It works.

nicolaselorr avatar Feb 11 '20 02:02 nicolaselorr

I am having the same error on latest react-native version

SyntaxError: /node_modules/react-native-general-calendars/node_modules/react-native-common/src/components/SegmentedControl.js: Unexpected reserved type string (20:30)

  18 |   static propTypes: {
  19 |     values: PropTypes.array,
> 20 |     selectionColor: PropTypes.string,
     |                               ^
  21 |     selectedIndex: PropTypes.number,
  22 |     onChange: PropTypes.func,
  23 |     titleStyle: PropTypes.any,

RCTFatal
__28-[RCTCxxBridge handleError:]_block_invoke
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main
start
0x0

dharma017 avatar Feb 11 '20 06:02 dharma017

same issue any progress here?

soheils2 avatar Apr 14 '20 15:04 soheils2

I installed https://www.npmjs.com/package/patch-package. I tried to edit the file to a working one. Then, run the command yarn patch-package react-native-common. It works.

tried this .... nothing changes am i missing something?

its urgent for me @rghorbani
reza jooon ;) your packege is great can you just make it work again?

دم شما گرم

soheils2 avatar Apr 14 '20 15:04 soheils2

Error in SegmentedControl.js

1- in vscode open /node_modules/react-native-common/src/components/SegmentedControl.js 2- In class SegmentedControl delete the following lines

  static propTypes: {
    values: PropTypes.array,
    selectionColor: PropTypes.string,
    selectedIndex: PropTypes.number,
    onChange: PropTypes.func,
    titleStyle: PropTypes.any,
    segmentStyle: PropTypes.any,
    style: ViewPropTypes.style,
  };

3- In class Segment delete the following lines

  props: {
    value: string;
    isSelected: boolean;
    selectionColor: string;
    segmentStyle?: any;
    titleStyle?: any;
    onPress: () => void;
  };

4- build your project

yarn build

5- Remember to redo this process every time running 'yarn install' or 'npm install' Or use https://www.npmjs.com/package/patch-package

KarimFereidooni avatar Aug 19 '20 09:08 KarimFereidooni

Same issue. Editing node_modules file is NOT a good option

mortocks avatar Sep 03 '20 01:09 mortocks

Also having this problem, with React version: 17.0.1.

Getting the following error:

Unexpected reserved type string (7:13)

 
 const formSchema = Yup.object().shape(schema:{
   email: Yup.string().required().email(),
                       ^
  password: Yup.string().required()
 });

has anybody been able to solve this yet?

CloudMunk avatar Feb 17 '21 13:02 CloudMunk