-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[Fixed in @react-native/babel-preset 0.76.4] Syntax error in EventEmitter.js when using Babel #46355
Comments
@mdjastrzebski thanks for flagging this! We have to update the Flow syntax Babel plugin used by Jest but this problem should not give issues at runtime. |
@cipolleschi thanks for checking this. I've run into this when I wanted to check how RN 0.76 + React 19 would work with RN Testing Library. I'll wait for a fix and resume my checks afterwards. |
Given that React 19 has not been released as stable yet, we are reverting the React 19 bump. |
Summary: Resolves facebook#46355. Changelog: [Internal] Differential Revision: D62583337
Summary: Resolves facebook#46355. Changelog: [Internal] Differential Revision: D62583337
Summary: Resolves facebook#46355. Changelog: [Internal] Differential Revision: D62583337
Summary: Resolves facebook#46355. Changelog: [Internal] Differential Revision: D62583337
Summary: Resolves facebook#46355. Changelog: [Internal] Differential Revision: D62583337
Summary: Pull Request resolved: facebook#46465 Resolves facebook#46355. Changelog: [Internal] Reviewed By: robhogan Differential Revision: D62583337
Summary: Pull Request resolved: facebook#46465 Resolves facebook#46355. Changelog: [Internal] bypass-github-export-checks Reviewed By: robhogan Differential Revision: D62583337
Summary: Pull Request resolved: facebook#46465 Resolves facebook#46355. Changelog: [Internal] bypass-github-export-checks Differential Revision: D62583337 Reviewed By: robhogan
im getting this same issue with react 18.3 and react native 0.76, whats the solution? edit:
and I was able to get past the error seems like it should automatically get applied though, my setup could be messed up |
am also facing this same issue. I have tried with changing the NDK versions: make newArchEnabled=false. It doesn't work for me. |
@huntie this is my config now, I added the transform part to fix the problem
from this pr basically when i upgraded dependencies I started getting the error But to be fair my setup is kinda unusual. |
@huntie I'm using the recommended preset and I still need to define the transform in my jest config to fix the error when running jest tests, see: carloscuesta/react-native-error-boundary#891 |
@huntie @robhogan Sorry for the tag but been dealing with this dead-end bug and couldn't resolve it.
My Setup: I tested it with React-native 0.76 and 0.76.1 still the same issue or error! What to do? I have even tried this solution:
This was an old react-native project, I removed deprecated plugins and only kept those that can be upgraded and replaced others.. but now am in this dead end bug... This is my package.json
|
@BryarGh Please try:
Note that the intended config within our Jest + Babel presets is here (latest relevant fix PR): 1387f52#diff-23432c49a1b0fbaa32ac0db0694a712f12f58619619948137f2cccf282fa61ceL28. We do expect projects to work out-of-the-box with these combined settings, which were shipped in 0.76.0. |
Hey! I was able to narrow down the issue thanks to @huntie's last comment. In my case problem was that the Reference: carloscuesta/react-native-error-boundary#897 |
Awesome. Yeah a general thing to note is that e.g. These should all be at |
Yup! I would've catched those while updating manually but did not with Dependabot, thanks for the help! 🙏🏼 |
@cipolleschi I am on RN 0.76.3, and facing this issue because I am using older version 0.75.3 for @react-native/babel-preset due to underlying issue with flow typed files #47933 |
I see that @huntie replied to you in the other issue. Let's move the conversation there. |
BUNDLE ./index.js ERROR SyntaxError: E:\user\dev\my_ems_app\node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js: Unexpected token, expected "]" (39:5) 37 |
How to fix the problem any one help? |
@goblin225 please update to the most recent version of React Native. We already fixed this. |
im using 0.76.5 and the issue is still there |
i am using "react": "^19.0.0",
|
I am also facing same issue, any temperory solution for this? |
@huntie Is there something else that should be done? |
@YohanisTaye87 @srahul99 Please ensure ALL
|
I had the same issue and struggled with it, it had been fixed but what I did... I started updating my project slowly but surly to avoid this issue again. The first time, I did bulk update of packages but second time .. All were good and worked out fine for me. |
{ |
test
script fails in 0.76-nightlty
I've updated the issue title to reflect the later user facing bug that became prevalent in comments.
(Meta only: this is the continued fallout of S472044.) |
This resolved |
Description
yarn test
fails on RN app from nightly template.Error:
This does not seem to be related to
react-test-renderer
deprecation but rather to Flow processing in RN repo.Steps to reproduce
npx react-native init RnNightly --version nightly
yarn install
yarn test
fails with reported error.React Native Version
0.76.0-nightly-20240905-62ee5c9b8
Affected Platforms
Other (please specify)
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/mdjastrzebski/rn-0.76-nightly-test
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: