Skip to content

Error integrating stream chat in react native expo app #3077

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

Open
Godwin004code opened this issue May 6, 2025 · 0 comments
Open

Error integrating stream chat in react native expo app #3077

Godwin004code opened this issue May 6, 2025 · 0 comments

Comments

@Godwin004code
Copy link

Hello there! I'm having issue integrating stream chat into my react native expo app. When I start the integration, I get this error first

Android Bundling failed 31259ms node_modules/expo-router/entry.js (2996 modules)
The package at "node_modules/axios/dist/node/axios.cjs" attempted to import the Node standard library module "crypto".
It failed because the native React runtime does not include the Node standard library.

but I was able to bypass this using this code

// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');

const config = getDefaultConfig(__dirname);

config.resolver.extraNodeModules = {
  ...config.resolver.extraNodeModules,
  crypto: require.resolve('./shims/empty.js'),
};

config.resolver.resolverMainFields = ['browser', 'module', 'main'];

module.exports = config;

but then this created another error

"Android Bundling failed 14838ms node_modules/expo-router/entry.js (2975 modules)
 ERROR  node_modules/react-native-safe-area-context/lib/module/specs/NativeSafeAreaView.js: /Users/boluwatife/Desktop/apps/dojoconnect-v2/node_modules/react-native-safe-area-context/lib/module/specs/NativeSafeAreaView.js: Could not find component config for native component". 

Steps to reproduce

  1. Add Stream Chat Wrapper in my _layout.tsx

If I remove stream chat from my project, my project works fine which implies that stream chat is the problem. Please provide any possible fix for me, Thank you!

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

No branches or pull requests

1 participant