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

Error on FunctionType Conversion #36

Open
TomPridham opened this issue Aug 16, 2019 · 3 comments
Open

Error on FunctionType Conversion #36

TomPridham opened this issue Aug 16, 2019 · 3 comments

Comments

@TomPridham
Copy link

i'm getting the following error: TypeError: Property parameters expected type of array but got object when trying to convert some flow files. i've narrowed it down to the following code

// @flow

export type RolesProps = {
  roles: Array<Role>,
  activeRoles: Array<string>,
  accountGuid: string,
  setError: (string) => void,
  setTooltip: (string) => void,
}

i think it is related to this line in the plugin: https://github.com/Kiikurage/babel-plugin-flow-to-typescript/blob/master/src/converters/convert_flow_type.ts#L330

commenting out those two function definitions results in a successful compilation

@zxbodya
Copy link
Contributor

zxbodya commented Aug 17, 2019

Hi @TomPridham

it looks issue is already fixed in master, but the version in npm is outdated

as a workaround, you can try using my fork @zxbodya/babel-plugin-flow-to-typescript (latest version there should be the same as current master)

@Kiikurage can you publish a new version to npm?

@TomPridham
Copy link
Author

great, that worked. thanks! should i close this or wait until a new version has been published?

@chrisdopuch
Copy link

I ran into the same problem today with this test code:

type xType = {|
  data: number,
  onClick: (e: string) => void // this is the problem line
|}

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

3 participants