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

Expo 51 event-target-shim/package.json Package subpath './index' is not defined #1567

Closed
b0iq opened this issue May 14, 2024 · 12 comments · May be fixed by expo/config-plugins#235
Closed

Expo 51 event-target-shim/package.json Package subpath './index' is not defined #1567

b0iq opened this issue May 14, 2024 · 12 comments · May be fixed by expo/config-plugins#235

Comments

@b0iq
Copy link

b0iq commented May 14, 2024

Expected Behavior:

Running fresh Expo dev client
I have followed the guide and edit metro.config.js

Observed Behavior:

Android Bundling failed 3615ms node_modules/expo/AppEntry.js (668 modules)
error: Error: Package subpath './index' is not defined by "exports" in /Users/user/imyproject/node_modules/react-native-webrtc/node_modules/event-target-shim/package.json

Steps to reproduce the issue:

  1. create expo dev client project
  2. install react-native-webrtc
  3. edit metro.config.js
  4. call registerGlobals

Platform Information

  • React Native Version: 0.74.1
  • WebRTC Module Version: 118.0.7
  • Platform OS + Version: Android + Expo 51
  • "@config-plugins/react-native-webrtc": "^9.0.0",
@doublex
Copy link

doublex commented May 16, 2024

Did you find a solution?

@b0iq
Copy link
Author

b0iq commented May 16, 2024

Did you find a solution?

Yes, just ignore metro.config.js

@doublex
Copy link

doublex commented May 16, 2024

Thanks!

@santhoshvai
Copy link
Contributor

@b0iq please close the issue ;)

@saghul saghul closed this as completed Jun 17, 2024
@Chirag-kalsariya
Copy link

Chirag-kalsariya commented Jul 12, 2024

This issue still in my new project.

I am using Turborepo.

`Android Bundling failed 16847ms index.js (1 module)
Unable to resolve "event-target-shim/index" from "../../node_modules/@stream-io/react-native-webrtc/src/MediaDevices.ts"
ERROR [Error: undefined Unable to resolve module event-target-shim/index from /Users/chirag/Heatrabbit/client-tamagui/node_modules/@stream-io/react-native-webrtc/src/MediaDevices.ts: event-target-shim/index could not be found within the project or in these directories:
node_modules
../../node_modules

1 | import { EventTarget, Event, defineEventAttribute } from 'event-target-shim/index';
| ^
2 | import { NativeModules } from 'react-native';
3 |
4 | import getDisplayMedia from './getDisplayMedia';]
`

My packages:
"expo": "^51.0.0", "react-native": "0.74.2", "@stream-io/react-native-webrtc": "^118.1.0", "@config-plugins/react-native-webrtc": "^9.0.0"

@8BallBomBom
Copy link
Member

You are using a different WebRTC package.
This is react-native-webrtc not @stream-io/react-native-webrtc

@Chirag-kalsariya
Copy link

@stream-io/react-native-webrtc is forked from react-native-webrtc.

Maybe @stream-io/react-native-webrtc is not up to date with react-native-webrtc. And, because of that I am facing this issue. @santhoshvai

Let me try out using original react-native-webrtc.

@8BallBomBom
Copy link
Member

That would be correct, as a forked repo things aren't necessarily up to date with changes from the original repo.
Best to either use this repo as you said or ask for support on the forked repo.

@Chirag-kalsariya
Copy link

In my case, I am using tamagui with turborepo. So, In my metro config this line is forcing metro to resolve (sub)dependencies only from the nodeModulesPaths.

// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
config.resolver.disableHierarchicalLookup = true

So, remove this line and everything is working fine. For more info expo/config-plugins#235

@saghul
Copy link
Member

saghul commented Jul 15, 2024

Shall we close this then?

@Chirag-kalsariya
Copy link

Shall we close this then?

yes

@Highnesslin
Copy link

In my case, I am using tamagui with turborepo. So, In my metro config this line is forcing metro to resolve (sub)dependencies only from the nodeModulesPaths.

// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
config.resolver.disableHierarchicalLookup = true

So, remove this line and everything is working fine. For more info expo/config-plugins#235

when I follow your code, there is another error in my applications.
ERROR Error: WebRTC native module not found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants