-
-
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
Build error no-undef
for flowtypes with class properties
#2604
Comments
no-undef
for flowtypes with class properties
I gave this a 👍 earlier, but I just downloaded your example and can't reproduce the error. I'm using Node 7.10.0, if it matters. The weird part is, I can still reproduce similar problems on my own project. For one of my components: export default class Something extends Component {
props: {
foo: string,
}; results in:
Weirder still, and I'm not sure if it's related, I have another component where adding an arrow function property: export default class SomethingElse extends Component {
handleChange = (event) => {
console.log(event);
}; results in:
But weirder still, changing the method's name to export default class SomethingElse extends Component {
test = (event) => {
console.log(event);
}; I can't pin down an exact pattern, but I feel like this is all related. Thoughts? |
I've also experienced the issue with arrow functions. Though I think running flow by itself found other issues that later alleviated the arrow-no-undef issue. |
I can't reproduce this with https://github.com/ubershmekel/create-react-app-flowtypes on Node 7.9.0. I tried both with npm 4.6.1 and with Yarn 0.24.3. We'll need more details about how to reproduce this. |
On a fresh clone I wasn't able to reproduce the issue either. I folder-diffed vs the reproducing check out and saw no differences. Then I moved my bugged folder elsewhere and it stopped bugging out. I narrowed it down to a
I guess for me the surprise is that the build isn't folder-local. |
I think this issue might be from eslint 4.0 since when I upgraded from 3.19 to 4.0 a while ago I got this issue. So I had to stick with eslint 3.19. Though I'm not entirely sure why upgrading eslint would cause this |
Oh, I see. Thank you so much for the repro case, it will be very useful. The incompatibility with ESLint 4.0 is a known issue. We haven’t dug into it yet because nothing is forcing us to upgrade. I’m surprised why |
In my case, I ran |
Aah okay that explains it. We probably need to do something to resolve |
I think this will be fixed once webpack-contrib/eslint-loader#181 is unreverted and we can use that option. |
In the meantime, downgrading my own version to 3.19 cleared everything up. |
I'll close this as it's not a bug, but caused by using incompatible version of ESLint. This is tracked in #2644 now. |
@gaearon I just updated to the newest CRA and this seems to have popped up again for me. I'm wondering now that CRA uses eslint 4 is this is a bug now? Is anyone else running into this? |
In |
+1, still getting this |
i my case conflict with react-script |
Commenting on a closed issue is futile. This is what the notification list looks like for me (and many other maintainers): This is 2024 unread issues. And I only watch this and a few other projects. Do you expect anyone to be able to read through this? If you're commenting in a closed issue, the only place where your comment appears is in the notifications. If I fail to read the notifications I won't see it. If you just add "thumbs up" to a comment that's a guarantee I'll never even have any idea you were here. :-) This is why if you experience a problem after an issue was closed you should file a new issue. With a reproducing case. Thanks. |
Can you reproduce the problem with npm 4.x?
Yes
Description
An error when running
yarn run build
occurs if I add a class property with a type to a react component. E.g.Expected behavior
✨ Done in 11.24s.
Actual behavior
Note that
yarn run flow
raises no issue. So I'm guessing it's an eslint problem but there's no way to tell from the build output. Would be nice if the errors were tagged with their source (vs code does this in theproblems
panel).Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected): [email protected]node -v
: v7.9.0npm -v
: 4.6.1Then, specify:
Reproducible Demo
https://github.com/ubershmekel/create-react-app-flowtypes
Related to
kitze#12
#567
The text was updated successfully, but these errors were encountered: