-
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
i am upgrading react native version 0.75.2 T0 0.76.5 But i am gtting issue unable to run project / I am using javaScript #48228
Comments
Warning Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:
|
Note Not a bug report: This issue looks like a question. We are using GitHub issues exclusively to track bugs in React Native. GitHub may not be the ideal place to ask a question, but you can try asking over on Stack Overflow, or on Reactiflux. |
I managed to fix this issue by replacing |
This fixes the code coverage github action. Without this change, we were getting the error ``` i FAIL www/__tests__/DateSelect.test.tsx ● Test suite failed to run SyntaxError: /private/tmp/e-mission-phone/node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js: Unexpected token, expected "]" (39:5) ``` The last successful run was from Oct 17. The first failed run was from Oct 23. We have not made any changes to the react-native components that we directly import since Sept 2024. However, we use a carat semver, so we will pull newly released minor versions. One of our dependencies bumped up the version of RN that they use, and released a new minor version, which broke this. After fruitlessly searching around for a root cause (as documented in the PR comments), since we import a lot of components and it was laborious to check when each of them have been updated, I did a brute force search in GitHub for this error and found both the same issue facebook/react-native#48228 and a fix that worked facebook/react-native#48228 (comment) I am surprised this has not been reported widely, but I guess it is fairly new! Thanks to @Basil-Code for the suggestion!
Even with the suggestion from @Basil-Code I face this problem |
@arelstone - I feel you, I have been struggling with the same issue after upgrading to expo 52. I'm using expo with an nx monorepo. Changing to 'module:@react-native/babel-preset' didn't fix it (albeit anti-pattern anyhow for an expo project) What's weird, is I created a separate project (using My working package.json{
"name": "@nx-expo-example/source",
"version": "0.0.0",
"license": "MIT",
"scripts": {},
"private": true,
"dependencies": {
"@expo/metro-config": "~0.19.4",
"@expo/metro-runtime": "~4.0.0",
"@react-native-firebase/app": "^21.6.2",
"expo": "~52.0.11",
"expo-splash-screen": "~0.29.13",
"expo-status-bar": "~2.0.0",
"react": "~18.3.1",
"react-dom": "~18.3.1",
"react-native": "0.76.6",
"react-native-svg": "~15.8.0",
"react-native-svg-transformer": "~1.5.0",
"react-native-web": "~0.19.13",
"expo-build-properties": "~0.13.2",
"expo-dev-client": "~5.0.9"
},
"devDependencies": {
"@eslint/js": "^9.8.0",
"@expo/cli": "~0.21.8",
"@nx/devkit": "20.3.1",
"@nx/eslint": "20.3.1",
"@nx/eslint-plugin": "20.3.1",
"@nx/expo": "20.3.1",
"@nx/jest": "20.3.1",
"@nx/js": "20.3.1",
"@nx/playwright": "20.3.1",
"@nx/workspace": "20.3.1",
"@playwright/test": "^1.36.0",
"@swc-node/register": "~1.9.1",
"@swc/core": "~1.5.7",
"@swc/helpers": "~0.5.11",
"@testing-library/jest-native": "~5.4.3",
"@testing-library/react-native": "~12.9.0",
"@types/jest": "^29.5.12",
"@types/node": "18.16.9",
"@types/react": "~18.3.12",
"babel-jest": "^29.7.0",
"babel-preset-expo": "~12.0.1",
"eslint": "^9.8.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jsx-a11y": "6.10.1",
"eslint-plugin-playwright": "^1.6.2",
"eslint-plugin-react": "7.35.0",
"eslint-plugin-react-hooks": "5.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-expo": "~52.0.2",
"nx": "20.3.1",
"prettier": "^2.6.2",
"react-test-renderer": "~18.3.1",
"ts-jest": "^29.1.0",
"ts-node": "10.9.1",
"tslib": "^2.3.0",
"typescript": "~5.6.2",
"typescript-eslint": "^8.13.0"
}
} .babelrc.jsmodule.exports = (api) => {
api.cache(true);
return {
presets: ["babel-preset-expo"],
};
}; |
In my case, it ended up being related to my monorepo, there was a stale set of If you run into this because of expo, look at the runtime version in your expo devtools. If it doesn't match what you expect, that is the root cause, a mismatch between native & js libraries.
|
Description
37 |
38 | type Registry<TEventToArgsMap: {...}> = {
ERROR SyntaxError: /Users/harishpalsande/Desktop/projects/native/imeuswe-mobile-native/node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js: Unexpected token, expected "]" (39:5)
37 |
38 | type Registry<TEventToArgsMap: {...}> = {
ERROR SyntaxError: /Users/harishpalsande/Desktop/projects/native/imeuswe-mobile-native/node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js: Unexpected token, expected "]" (39:5)
37 |
38 | type Registry<TEventToArgsMap: {...}> = {
Steps to reproduce
upgrading react native version 0.75.2 T0 0.76.5
React Native Version
0.76.5
Affected Platforms
Runtime - Android, Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
d
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: