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

Description

@lawrenehi

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.

Activity

  1. parse-github-assistant commented on Jun 2, 2025

    @parse-github-assistant

    🚀 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.

  2. lawrenehi commented on Jun 2, 2025

    @lawrenehi
    Author

    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

  3. lawrenehi commented on Jun 2, 2025

    @lawrenehi
    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

  4. dplewis commented on Jun 2, 2025

    @dplewis
    Member

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

    Image
  5. riohifi commented on Jul 5, 2025

    @riohifi

    node_modules/parse/node_modules/ws/lib/stream.js: stream could not be found within the project or in these directories:
    node_modules/parse/node_modules
    node_modules
    ../../../../node_modules
    1 | 'use strict';
    2 |

    3 | const { Duplex } = require('stream');
    | ^
    4 |

    "@d11/react-native-fast-image": "^8.9.2",
    "@parse/react-native": "^0.0.1-alpha.18",
    "@react-native-async-storage/async-storage": "^2.2.0",
    "@react-native/new-app-screen": "0.80.0",
    "@react-navigation/bottom-tabs": "^7.3.17",
    "@react-navigation/native": "^7.1.13",
    "@react-navigation/stack": "^7.3.6",
    "lottie-react-native": "^7.2.3",
    "nativewind": "^4.1.23",
    "parse": "^5.3.0",
    "react": "19.1.0",
    "react-native": "0.80.0",
    "react-native-gesture-handler": "^2.26.0",
    "tailwindcss": "^3.4.17"

  6. added
    type:bugImpaired feature or lacking behavior that is likely assumed
    on Jul 5, 2025
  7. chr4ss1 commented on Jul 22, 2025

    @chr4ss1

    same error, latest parse does not work with react 0.79

  8. UsamaAshraf82 commented on Aug 9, 2025

    @UsamaAshraf82

    +1

  9. Emehado commented on Aug 12, 2025

    @Emehado

    facing similar issue

  10. UsamaAshraf82 commented on Aug 13, 2025

    @UsamaAshraf82

    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

    This is working

  11. tiavina-mika commented on Jan 8, 2026

    @tiavina-mika

    For Parse SDK < 6.x:
    This config.resolver.unstable_enablePackageExports = false; workaround works.

    For 7.x:
    The following fixes the issue:

    npx expo install expo-crypto  
    npm install react-native-get-random-values

    And add this at the very top of your entry file (e.g. app/_layout.tsx):

    import 'react-native-get-random-values';

    For 8.x:
    None of the above workarounds are effective. The SDK now directly uses Node’s crypto.randomUUID() in lib/react-native/uuid.js, which is incompatible with Expo’s runtime (see error in #2856). A proper React Native–compatible UUID fallback is needed.

  12. parseplatformorg commented on Jan 27, 2026

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 8.0.4-alpha.1

  13. parseplatformorg commented on Feb 5, 2026

    @parseplatformorg
    Contributor

    🎉 This change has been released in version 8.1.0

  14. lawrenehi commented on Feb 6, 2026

    @lawrenehi
    Author

    what is the fix? i still get the error 8.1.0

  15. dplewis commented on Feb 6, 2026

    @dplewis
    Member

    @lawrenehi Can you open a new issue?

  16. lawrenehi commented on Feb 7, 2026

    @lawrenehi
    Author

    Apologies, yes this is another issue..

  17. reopened this on Feb 8, 2026
  18. dplewis commented on Feb 8, 2026

    @dplewis
    Member

    @lawrenehi My bad, I didn't see you were the OP. Can you post the contents of your node_modules/parse/lib/react-native/WebSocketController.js? Are you seeing any new errors?

  19. lawrenehi commented on Feb 9, 2026

    @lawrenehi
    Author

    thanks, it failed on me, but on a second check it was a different issue
    crypto could not be found error. so i cant really check if it is fixed on this version because of the crypto issue which is being fixed here #2858

    at this time this release is unusable for react-native users

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:releasedReleased as stable versionstate:released-alphaReleased as alpha versiontype:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions