-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
RN project fails with "Property body[6] of BlockStatement..." (Babel related issue) #31960
Comments
This comment has been minimized.
This comment has been minimized.
Same here |
1 similar comment
Same here |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- package-lock.json taken from https://github.com/codingki/react-native-expo-template/blob/master/template-typescript-bottom-tabs-supabase-auth-flow/package-lock.json - original issue: facebook/react-native#31960
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Still facing the same issue, updating plugin to 7.15.1 doesnt help. |
@Revolt9k Can you share your lockfile? |
@nicolo-ribaudo Lockfile is too long to put it here, so I had to upload it in readme file in empty repository. You can check it there - https://github.com/Revolt9k/lockfile |
@Revolt9k me and @nicolo-ribaudo have just done a pairing session to verify that So, to more completely provide a resolution if you are still experiencing the problem:
Doing so will ensure that Metro will pick up the correct plugin and things should work again for you too :) |
@nicolo-ribaudo you can follow https://reactnative.dev/docs/environment-setup to create and build a project. If the error happens on Android, you should be able to repro on Linux as well. If it happens on iOS only, you will need MacOS. |
@sammy-SC yeah the error happens at the Metro step so the Babel team should be even able to get a "small footprint" CI setup for their workflow that is able to catch these kind of issues in the future: babel/babel#13639 |
Thank you guys, reseting Metro cache finally fixes the issue. You are amazing <3. |
I have still problem. |
Thanks for this solution, for people who still have the problem, make sure you are following the step by step of the friend from above. |
After applying the fix I get a new issue.
Should I just scrap it and create a new project? |
resolvi segue a solução: digita dentro do seu projeto: npm update @babel/plugin-transform-react-display-name após finalizar a atualização, so dar npx react-native run-android e seja feliz |
Closing as the team got a resolution for this. |
EDIT by @kelset: this is caused by a Babel release, read more at this comment. The offending commit has been reverted, as mentioned here - so the issue is solved now. If you are still experiencing it, follow the steps described here.
PLEASE don't post comments like "same here", they only create noise
When creating a new project via
npx react-native init Foo --template react-native-template-typescript
, then running the defaultyarn ios
metro throws a compile error:error: node_modules/react-native/Libraries/Image/ImageAnalyticsTagContext.js: Property body[6] of BlockStatement expected node to be of a type ["Statement"] but instead got "AssignmentExpression"
Tested using:
The text was updated successfully, but these errors were encountered: