-
-
Notifications
You must be signed in to change notification settings - Fork 26.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
TypeError: Cannot read property 'bind' of undefined when using Flow #5176
Comments
This is because Babel 7 changed the behavior of class properties so that an empty “definition” like this is treated as assigning We’ll need to mention this in migration notes. Still I’m not sure if this is correct. We’ll need more eyes on this. Some discussion: babel/babel#8417. Apparently this could solve it? xing/hops@9cf7791 |
The thing is that Flow is asking me to add a type definition to |
Yeah, I understand. We'll need to dig deeper into this. |
Ok, thanks. Let me know if I can help somehow |
@Gpx try this. This uses the flow commenting method. Obviously not ideal but it should provide with a workaround.
|
@bugzpodder yep, that works, unfortunately, in my app, we use prettier which converts comments into standard type definitions. I think we'll wait to update CRA until this issue has been closed |
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
Which terms did you search for in User Guide?
flow
bind
Environment
Steps to Reproduce
Foo
TypeError: Cannot read property 'bind' of undefined
Expected Behavior
The file should run in the tests
Actual Behavior
I think Flow's syntax is confusing the tests. Note that this same code was working in the previous version of CRA
Reproducible Demo
Simply clone https://github.com/Gpx/cra2-bind and run the tests
The text was updated successfully, but these errors were encountered: