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

Unexpected reserved type string #38

Open
ghorbani-m opened this issue Dec 21, 2019 · 10 comments
Open

Unexpected reserved type string #38

ghorbani-m opened this issue Dec 21, 2019 · 10 comments

Comments

@ghorbani-m
Copy link
Contributor

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)`

@rghorbani
Copy link
Owner

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

@nicolaselorr
Copy link

nicolaselorr commented Feb 10, 2020

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

@nicolaselorr
Copy link

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.

@dharma017
Copy link

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

@soheils2
Copy link

same issue any progress here?

@soheils2
Copy link

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?

دم شما گرم

@KarimFereidooni
Copy link

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

@mortocks
Copy link

mortocks commented Sep 3, 2020

Same issue. Editing node_modules file is NOT a good option

@CloudMunk
Copy link

CloudMunk commented Feb 17, 2021

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?

@sundardsTechMind
Copy link

i'm also having same issue

AuthSignUpContainer.js:

error: bundling failed: SyntaxError: Unexpected reserved type any. (14:31)

13 | type Props = {

14 | AuthSignUpReducer: PropTypes.any,
| ^
15 | authSignUpReset: PropTypes.func,
16 | authSignUpDismissMessages: PropTypes.func,
17 | };

can anyone help me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants