Skip to content

The package at "node_modules/parse/node_modules/ws/lib/stream.js" attempted to import the Node standard library module "stream" #2633

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
4 tasks done
lawrenehi opened this issue Jun 2, 2025 · 4 comments

Comments

@lawrenehi
Copy link

New Issue Checklist

Issue Description

On react-native with expo - build , the launch/build fails with the following error
if you add events and stream, you get http and https error too

Android Bundling failed 612ms node_modules/expo-router/entry.js (1315 modules)
The package at "node_modules/parse/node_modules/ws/lib/stream.js" attempted to import the Node standard library module "stream".
It failed because the native React runtime does not include the Node standard library.

Steps to reproduce

Create a react native app using

  • npx create-expo-app@latest
  • npm i parse#
  • const Parse = require('parse/react-native.js');
  • npx expo run:android
  • run the app on emulator or mobile

Actual Outcome

App should build

Expected Outcome

Environment

"expo-system-ui": "~5.0.7",
"expo-web-browser": "~14.1.6",
"parse": "^6.1.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-native": "0.79.2",

Server
NA

Database
NA

Client

  • Parse JS SDK version: 6.1.1

Logs

Android Bundling failed 612ms node_modules/expo-router/entry.js (1315 modules)
The package at "node_modules/parse/node_modules/ws/lib/stream.js" attempted to import the Node standard library module "stream".
It failed because the native React runtime does not include the Node standard library.

Copy link

🚀 Thanks for opening this issue!

ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@lawrenehi
Copy link
Author

lawrenehi commented Jun 2, 2025

found a probable workaround from the expo team

https://docs.expo.dev/versions/latest/config/metro/#packagejsonexports

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

/** @type {import('expo/metro-config').MetroConfig} */
const config = getDefaultConfig(__dirname);

config.resolver.unstable_enablePackageExports = false;

module.exports = config;

i will test to see if this has an impact on Parse, but it seems to take away the error. This issue might be related to ws required by Parse

@lawrenehi
Copy link
Author

not related but this error should be in the documentation for latest react-native

https://github.com/uuidjs/uuid?tab=readme-ov-file#getrandomvalues-not-supported

@dplewis
Copy link
Member

dplewis commented Jun 2, 2025

Basically ws is not used in react-native but it didn't get cleaned up (tree-shaking) when the build was output.

Image

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

No branches or pull requests

2 participants