-
Notifications
You must be signed in to change notification settings - Fork 505
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
Metro error: Unable to resolve module stream/web #2806
Comments
Undici is a library for Node.js. It's not a library for expo. I'd recommend you to use global fetch instead (if it's available on Expo). |
I am not doing anything special in my application. I believe it has to do with the Undici lib calling something out of date or incorrectly. |
Here is some more information. Firebase -> Undici -> stream/web (cannot be found or downloaded via npm or yarn) Metro error: Unable to resolve module undici from /Users/justin/coreApp/node_modules/@firebase/auth/dist/node/index.js: undici could not be found within the project or in these directories:
|
Has this been resolved yet? I am receiving the same error after connecting my app to Firebase. |
I am having the same problem with a basic expo@50 setup and firebase.js auth on web. |
I am running into this issue as well and I have tried some of other pkg solution without luck.
npx create-expo-app coreApp --template tabs@50
Install firebase resources
% npm install firebase @react-native-firebase/app @react-native-firebase/auth
I am able to login to my mobile app with this tutorial on IOS but when I try using expo web I get that error below.
https://github.com/Cebraiil/firebase_auth_tutorial/blob/master/App.js
ERROR
Metro error: Unable to resolve module stream/web from /Users/justin/coreApp/node_modules/undici/lib/core/util.js: stream/web could not be found within the project or in these directories:
node_modules
369 | function ReadableStreamFrom (iterable) {
370 | if (!ReadableStream) {
371 | ReadableStream = require('stream/web').ReadableStream
| ^
372 | }
373 |
374 | if (ReadableStream.from) {
I have tried to install the stream npm package and that didn't solve it either.
Environment
% npm -v
10.4.0
% node -v
v18.19.0
package.json = does not work
{
"name": "coreapp",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^14.0.0",
"@react-native-firebase/app": "^18.9.0",
"@react-native-firebase/auth": "^18.9.0",
"@react-navigation/native": "^6.0.2",
"expo": "~50.0.7",
"expo-font": "~11.10.3",
"expo-linking": "~6.2.2",
"expo-router": "~3.4.7",
"expo-splash-screen": "~0.26.4",
"expo-status-bar": "~1.11.1",
"expo-system-ui": "~2.9.3",
"expo-web-browser": "~12.8.2",
"firebase": "^10.8.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.73.4",
"react-native-safe-area-context": "4.8.2",
"react-native-screens": "~3.29.0",
"react-native-web": "~0.19.6"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/react": "~18.2.45",
"jest": "^29.2.1",
"jest-expo": "~50.0.2",
"react-test-renderer": "18.2.0",
"typescript": "^5.1.3"
},
"pkg": {
"patches": {
"./node_modules/undici/lib/fetch/body.js": ["require('stream/web')", "require('stream').web"],
"./node_modules/undici/lib/core/util.js": ["require('stream/web')", "require('stream').web"],
"./node_modules/undici/lib/fetch/request.js": ["require('stream/web')", "require('stream').web"],
"./node_modules/undici/lib/fetch/index.js": ["require('stream/web')", "require('stream').web"]
}
},
"private": true
}
The text was updated successfully, but these errors were encountered: