-
Notifications
You must be signed in to change notification settings - Fork 105
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
fix: event-target-shim/package.json Package subpath './index' is not defined in react-native-webrtc
config plugin
#235
base: main
Are you sure you want to change the base?
Conversation
Event Target Shim
section from react-native-webrtc
config pluginEvent Target Shim
section from react-native-webrtc
readme
Event Target Shim
section from react-native-webrtc
readmereact-native-webrtc
config plugin
@@ -39,48 +39,6 @@ After installing this npm package, add the [config plugin](https://docs.expo.io/ | |||
|
|||
Next, rebuild your app as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide. | |||
|
|||
### Event Target Shim | |||
|
|||
> SDK 50 and greater. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still relevant for SDK 50 users. Would just change it to not say "and greater"
Hi @EvanBacon, I have tested Expo SDK 50 with [email protected] and @config-plugins/[email protected], and it is working fine. I think it would be better if we update the compatibility table. |
This issue still in my new project. I am using Turborepo. `Android Bundling failed 16847ms index.js (1 module)
My packages: |
@Chirag-kalsariya Could you please share your |
Here it is my metro-config.js
If i use this I get above error. error Now I change it my metro-config.js like this
Now I am getting this error
One more thing I am using @stream-io/react-native-webrtc, And I think it is same as react-native-webrtc. |
Let me verify this issue again using |
Just remove this lines from your
Try this const { getDefaultConfig } = require("@expo/metro-config");
const path = require("path");
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, "../..");
const config = getDefaultConfig(projectRoot);
// 1. Watch all files within the monorepo
config.watchFolders = [workspaceRoot];
// 2. Let Metro know where to resolve packages and in what order
config.resolver.nodeModulesPaths = [path.resolve(projectRoot, "node_modules"), path.resolve(workspaceRoot, "node_modules")];
config.transformer = { ...config.transformer, unstable_allowRequireContext: true };
config.transformer.minifierPath = require.resolve("metro-minify-terser");
module.exports = config; |
Yes, Above metro config is working, No errors. And, I also test new expo project not with monorepo, |
I am having a bit of a different problem
And after the build is completed getting these repeating errors My metro.config.js looks like this const { getDefaultConfig } = require("expo/metro-config");
const { FileStore } = require("metro-cache");
const path = require("path");
// Find the workspace root, this can be replaced with `find-yarn-workspace-root`
const workspaceRoot = path.resolve(__dirname, "../..");
const projectRoot = __dirname;
const config = getDefaultConfig(projectRoot);
const monorepoPackages = {
"@repo/mobile-assets": path.resolve(workspaceRoot, "packages/mobile-assets"),
"@repo/mobile-ui": path.resolve(workspaceRoot, "packages/mobile-ui"),
"@repo/services": path.resolve(workspaceRoot, "packages/services"),
"@repo/types": path.resolve(workspaceRoot, "packages/types"),
"@repo/locales": path.resolve(workspaceRoot, "packages/locales"),
};
// 1. Watch the local app folder, and only the shared packages (limiting the scope and speeding it up)
config.watchFolders = [projectRoot, ...Object.values(monorepoPackages)];
// Add the monorepo workspaces as `extraNodeModules` to Metro.
// If your monorepo tooling creates workspace symlinks in the `node_modules` folder,
// you can either add symlink support to Metro or set the `extraNodeModules` to avoid the symlinks.
// See: https://facebook.github.io/metro/docs/configuration/#extranodemodules
config.resolver.extraNodeModules = monorepoPackages;
// 2. Let Metro know where to resolve packages, and in what order
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, "node_modules"),
path.resolve(workspaceRoot, "node_modules"),
];
// Use turborepo to restore the cache when possible
config.cacheStores = [
new FileStore({ root: path.join(projectRoot, "node_modules", ".cache", "metro") }),
];
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
// config.resolver.disableHierarchicalLookup = true;
config.resolver.unstable_enablePackageExports = true;
config.resolver.unstable_conditionNames = ["browser", "require", "import", "react-native"];
module.exports = config; But when |
Why
Fixes #1569
How
react-native-webrtc
already forcing to use the correct event-target-shim module #1515.Test
When
event-target-shim
is requested byreact-native-webrtc
, Metro by default resolvesevent-target-shim
relative toreact-native-webrtc
.When both variables
isEventTargetShimPkg
andisWebrtc
are true,event-target-shim
is resolved relative toreact-native-webrtc
, as shown in the video.So, there is no need to explicitly resolve
event-target-shim
forreact-native-webrtc
.Screen.Recording.2024-05-16.at.7.30.30.PM.mov