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

I get this error in EventEmitter.js during the project build process. #48630

Closed
msuzenozka opened this issue Jan 13, 2025 · 3 comments
Closed
Labels
Debugger Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Resolution: Duplicate

Comments

@msuzenozka
Copy link

Description

ERROR SyntaxError: /Users/msuzen/SCMMobile/node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js: Unexpected token, expected "]" (39:5)

37 |
38 | type Registry<TEventToArgsMap: {...}> = {

39 | [K in keyof TEventToArgsMap]: Set<Registration<TEventToArgsMap[K]>>,
| ^
40 | };


{
"name": "SCMMobile",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.23.1",
"@react-native-community/datetimepicker": "^8.2.0",
"@react-native-community/geolocation": "^3.2.1",
"@react-native-community/masked-view": "^0.1.11",
"@react-navigation/drawer": "^6.6.3",
"@react-navigation/native": "^6.1.7",
"@react-navigation/stack": "^6.3.17",
"axios": "^1.6.8",
"date-fns": "^3.6.0",
"lodash": "^4.17.21",
"lottie-react-native": "^6.7.2",
"react": "18.3.1",
"react-native": "^0.76.6",
"react-native-dropdown-picker": "^5.4.6",
"react-native-element-dropdown": "^2.12.0",
"react-native-elements": "^3.4.3",
"react-native-gesture-handler": "^2.16.2",
"react-native-get-location": "^4.0.1",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-modal-datetime-picker": "^16.0.0",
"react-native-safe-area-context": "^4.7.1",
"react-native-screens": "^3.22.1",
"react-native-sqlite-storage": "^6.0.1",
"react-native-storage": "^0.2.4",
"react-native-svg-transformer": "^1.5.0",
"react-native-uuid": "^2.0.2",
"react-native-vision-camera": "^4.0.3",
"react-native-webview": "^13.10.2",
"react-native-worklets-core": "^1.5.0"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/plugin-transform-class-properties": "^7.25.9",
"@babel/plugin-transform-private-methods": "^7.25.9",
"@babel/plugin-transform-private-property-in-object": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.26.3",
"@babel/runtime": "^7.26.0",
"@react-native-community/cli": "^15.1.3",
"@react-native/babel-preset": "^0.76.6",
"@react-native/eslint-config": "^0.76.6",
"@react-native/metro-config": "^0.76.6",
"@tsconfig/react-native": "^3.0.5",
"@types/react": "^18.3.18",
"@types/react-native": "^0.72.8",
"@types/react-native-sqlite-storage": "^6.0.5",
"@types/react-native-vector-icons": "^6.4.18",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "^0.76.5",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.4.1",
"react-native-paper": "^5.12.5",
"react-native-reanimated": "^3.16.6",
"react-test-renderer": "18.2.0",
"typescript": "^4.8.4"
},
"engines": {
"node": ">=16"
}
}

Steps to reproduce

npm install
npx react-native run-ios

React Native Version

0.76.6

Output of npx react-native info

System:
  OS: macOS 15.1.1
  CPU: (4) x64 Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
  Memory: 1.68 GB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.5.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 3.4.1
    path: /usr/local/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.3
    wanted: ^15.1.3
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.6
    wanted: ^0.76.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: false
  newArchEnabled: true

msuzen@MACs-iMac SCMMobile % 
 *  History restored 

msuzen@MACs-iMac SCMMobile % npx react-native info
(node:1628) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
warn Package react-native-sqlite-storage contains invalid configuration: "dependency.platforms.ios.project" is not allowed. Please verify it's properly linked using "npx react-native config" command and contact the package maintainers about this.
info Fetching system and libraries information...
System:
  OS: macOS 15.1.1
  CPU: (4) x64 Intel(R) Core(TM) i5-7400 CPU @ 3.00GHz
  Memory: 13.06 GB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.5.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 3.4.1
    path: /usr/local/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.3
    wanted: ^15.1.3
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.6
    wanted: ^0.76.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: false
  newArchEnabled: true

Screenshots and Videos

image

@msuzenozka msuzenozka added Debugger Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Needs: Triage 🔍 labels Jan 13, 2025
@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. labels Jan 13, 2025
@react-native-bot
Copy link
Collaborator

Warning

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

@cipolleschi
Copy link
Contributor

duplicated of #46355.

@msuzenozka please do not open duplicated issues, I saw you already found the original one. Read through the comments as @huntie already provided resolution there.

@muratsuzen
Copy link

I'm having the same problem, although I tried the suggested solution. Does anyone have any other solution suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debugger Issues related to React Native DevTools or legacy JavaScript/Hermes debugging Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Resolution: Duplicate
Projects
None yet
Development

No branches or pull requests

5 participants