Closed jbroma closed 2 months ago
We just landed a couple of picks to fix that. We are going to release RC.2 between today and tomorrow morning. Is it okay to wait for that?
We just landed a couple of picks to fix that. We are going to release RC.2 between today and tomorrow morning. Is it okay to wait for that?
absolutely, this just needs to be addressed before stable release of 0.76 👍
can you double check if this is fixed, now that RC2 is out? If yes, can we close this issue? 🙏
tried the RC.2 today and it's still not fixed, btw I've upgraded the repro to RC.2
I can confirm that! I was trying to test out the new debugger, but I'm also seeing flow errors
Looks like Riccardo was referencing these picked commits which made it into RC2 — these affect Jest only.
I think I came across this also being hit by our CI, recently in https://github.com/facebook/react-native/pull/45960 — but I forget my own context 😅. Anyway, will try and repro + land the fix.
Hey all, this is fixed! Will need to be picked into the next 0.76 RC also, tracked here: https://github.com/reactwg/react-native-releases/issues/538
Perhaps unpopular opinion, but isn't it time for react-native core to ship transpiled code? Shipping flow source code prevents use of modern javascript tooling and makes builds slower than it has to.
@oblador Oh I'm absolutely for this, and we're making some progress internally (prioritised behind other things) to be able to correctly build + emit types (including TypeScript!).
At the same time, 1/ this won't be ready soon, 2/ keeping complete type information may be important for Static Hermes. Need to understand, before we leap.
I am still getting Error .
NODE VERSION : v18.18.2
"react-native": "0.76.1",
"react": "18.3.1",
I am seeing the same on node 22.7, react-native 0.76.1, react 18.3.1.
I tried adding babel-plugin-syntax-hermes-parser to my babel config, but this did not resolve this
@ZainaliSyed @rowanarcher Can either of you link a repro project?
I am getting this same error as well when running an app. After the bundle finishes loading, the errors appears.
"react": "18.3.1", "react-native": "0.76.1",
New Architecture enabled or disabled does not seem to affect it. The error does not occur with RN 0.75.3 (which I upgraded from).
@huntie, is there a temp solution that I can try locally? I see your PR hasn't merged yet, but I'm not clear where the change is being made.
EDIT: nm, found it.. /node_modules/@react-native/eslint-config
--- making the parser changes there did not fix the issue.
Im using "react-native": "^0.76.1", "react": "18.3.1",
Im still getting this error when try to build Can't able to run the app in iOS
flow typed file started generating errors with latest version of RN and @react-native/babel-preset
Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/services/syncData/checkConnection.js
Line undefined, column undefined: Cannot read properties of undefined (reading 'forEach')
parseForESLint
from parser /Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@babel/eslint-parser/lib/index.cjs
is invalid and will just be ignored
Description
Problem
JavaScript files using newer Flow syntax (e.g.,
as
type casts) fail to transpile correctly in React Native's Metro preset whenhermesParser
is disabled. This is becausebabel-parser
no longer fully supports Flow, and Hermes parser is now required for handling the latest Flow features.Background
babel-parser
no longer fully supports newer Flow features due to the Flow plugin being unmaintained: https://github.com/babel/babel/issues/16264.hermesParser
by default in0.76.0
: https://github.com/facebook/react-native/pull/46318Proposed Solution
To make the Metro preset self-sufficient, we should consider including babel-plugin-syntax-hermes-parser in the preset. This would ensure that even when used without metro, babel can still transpile newer flow syntax properly.
Steps to reproduce
yarn install
yarn react-native start
http://localhost:8081/index.bundle?platform=ios
in the browser or by running the appReact Native Version
0.76.0-rc.1
Affected Platforms
Build - MacOS, Build - Windows, Build - Linux
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/jbroma/RN76BabelPresetReproducer
Screenshots and Videos
No response