-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Using Iterable as a function argument causes gen-flow-files to crash #3281
Comments
Hello darkness my old friend... I'm having the same kind of error; i.e. My instinct tells me it's due to me using a Let's see if I still have this error after I explicitly import these types... Ok, I changed those types for |
In case it's helpful, I ran into this and was able to reduce my code to this for reproducing the issue: // @flow
import type { Node } from 'react'
function myFn(node: Node) {
return node
}
export default myFn The error I get looks like this:
in case you're interested, here's the actual file// @flow
import React from 'react'
import type { Node } from 'react'
type Props = {
initialState: {},
render: ({ state: {}, setState: Function }) => Node,
}
type State = {}
class Comp extends React.Component<Props, State> {
static defaultProps = {
initialState: {},
render: () => null,
}
state = this.props.initialState
setState = this.setState.bind(this)
render() {
const { state, setState } = this
return this.props.render({ state, setState })
}
}
export default Comp I'm unsure how to resolve this, but it appears to be related to the original issue... |
Also, in case it's helpful to anyone looking for a workaround, I posted about this to my newsletter today. |
I got this error in another case:
// @flow
import { Message } from './Message';
import { DispatcherContext } from './DispatcherContext';
...
export {
Message,
DispatcherContext,
...
}; I manage to find workaround with: // @flow
export * from './index'; |
I'm seeing the same issue as @idanilt and @kentcdodds but their workaround doesn't seem to do the trick for me still seeing the following error:
|
This seems to be oddly infectious? I had a React functional component which worked fine with gen-flow-types, then added Node as a return type, and got this error. Removed the return type again, restoring the code that had previously worked - but the PolyT error has not gone away. A cache problem, or similar? |
same issue here. I have defined some flow types in a types.js file and get this error when running
|
gen-flow-files is removed. A replacement is coming soon. |
Running gen-flow-files on any of these snippets causes it to crash with:
Error: Failure("/path/to/IterableRepro.js: Failure(\"Unexpected global type: PolyT\")")
Flow version: 0.38.0
No libdefs, blank .flowconfig
The text was updated successfully, but these errors were encountered: