Skip to content
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

React Native 0.76.3 Eslint Parser Issue with Flow #47933

Open
ravindraguptacapgemini opened this issue Nov 25, 2024 · 3 comments
Open

React Native 0.76.3 Eslint Parser Issue with Flow #47933

ravindraguptacapgemini opened this issue Nov 25, 2024 · 3 comments
Labels
Flow Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.

Comments

@ravindraguptacapgemini
Copy link

ravindraguptacapgemini commented Nov 25, 2024

Description

I have recently migrated the app to 0.76.3 following the upgrade helper and also upgraded @react-native/babel-preset which has resulted in eslint parsing error for flow typed files.

Steps to reproduce

Using latest react native 0.76.3 with @react-native/babel-preset version 0.76.3, add some flow files.
Run yarn eslint

React Native Version

0.76.3

Affected Platforms

Other (please specify)

Output of npx react-native info

System:
  OS: macOS 15.0.1
  CPU: (12) arm64 Apple M2 Pro
  Memory: 502.45 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.5
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.2
    path: /usr/local/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/ravindragupta/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    API Levels:
      - "31"
      - "33"
      - "34"
      - "35"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
      - 35.0.0
    System Images:
      - android-26 | ARM 64 v8a
      - android-26 | Google APIs ARM 64 v8a
      - android-28 | Google ARM64-V8a Play ARM 64 v8a
      - android-30 | Google APIs ARM 64 v8a
      - android-30 | Google Play ARM 64 v8a
      - android-31 | Google Play ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12483815
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.0.4
    path: /Users/ravindragupta/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.3
    wanted: 0.76.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/oauth.api.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

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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/types.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/types.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/actions/saveUtils.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/records.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/types.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/urlRoute.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/types.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/records.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/actions/saveUtils.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/components/helpers/listField.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/oauth.api.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

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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/urlRoute.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/BaseField.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/records.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/actions/saveUtils.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/BaseField.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/records.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/actions/saveUtils.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/BaseField.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/BaseField.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

Error while parsing /Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.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

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/actions/popupMenu.action.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/actions/saveUtils.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/components/AnswerFields/AnswerRenderer.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/components/Detail/FieldsController.js
  178:9  warning  Invalid loop. Its body allows only one iteration  no-unreachable-loop

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/components/helpers/listField.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/BaseField.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/batch.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/batchList.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/filters.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/filters.operators.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/filters.operators.offline.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/metadata.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/oauth.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/offline.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/prefetch.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/prefetch.diffsync.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/prefetch.etags.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/records.api.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/types.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/api/urlRoute.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/services/realm.js
  10:1  warning  Dependency cycle detected  import/no-cycle

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/services/realmDb/RealmDbUpdates.js
  11:1  warning  Dependency cycle detected  import/no-cycle

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/services/syncData/checkConnection.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

/Users/ravindragupta/Desktop/Projects/mobilev2/native/src/mobileCore/services/syncData/syncDataWrappers.js
  0:0  error  Parsing error: Cannot read properties of undefined (reading 'forEach')

✖ 24 problems (21 errors, 3 warnings)

Reproducer

https://github.com/test

Screenshots and Videos

Screenshot 2024-11-25 at 11 38 55 PM
@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Flow labels Nov 25, 2024
@react-native-bot
Copy link
Collaborator

Warning

Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

@ravindraguptacapgemini
Copy link
Author

@cipolleschi can you please help me here identifying the changes in RN and react-native/babel-preset which can cause this issue

@huntie
Copy link
Member

huntie commented Dec 3, 2024

Hi @ravindraguptacapgemini — can you share your full ESLint config, and potentially the contents of one of your project's source files that fails parsing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Flow Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue.
Projects
None yet
Development

No branches or pull requests

3 participants