Skip to content
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

attempted to import the Node standard library module "node:stream" in React Native project #4005

Open
FloppiTuna opened this issue Aug 12, 2024 · 4 comments

Comments

@FloppiTuna
Copy link

FloppiTuna commented Aug 12, 2024

Previously, I was able to use Cheerio in one of my React Native applications. However after the recent release of v1.0.0 I receive an error upon launch due to it trying to import a NodeJS exclusive library:

The package at "node_modules/cheerio/dist/commonjs/index.js" attempted to import the Node standard library module "node:stream".
It failed because the native React runtime does not include the Node standard library.

expo-env-info output:

  expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 15.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.20.4 - ~/.nvm/versions/node/v18.20.4/bin/node
      npm: 10.7.0 - ~/.nvm/versions/node/v18.20.4/bin/npm
      Watchman: 2024.07.29.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.15.2 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 24.0, iOS 18.0, macOS 15.0, tvOS 18.0, visionOS 2.0, watchOS 11.0
    IDEs:
      Android Studio: 2024.1 AI-241.18034.62.2411.12071903
      Xcode: 16.0/16A5211f - /usr/bin/xcodebuild
    npmPackages:
      expo: ~51.0.26 => 51.0.26 
      expo-router: ~3.5.21 => 3.5.21 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.74.3 => 0.74.3 
    Expo Workflow: managed
    ```
@collinscoder1
Copy link

What is the last working version? I had the same error too!

@77TecShaeer
Copy link

+2

@FloppiTuna
Copy link
Author

FloppiTuna commented Aug 14, 2024 via email

@juanmigdr
Copy link

Same here, I get the exact same issue in react native:
The package at "node_modules/cheerio/dist/commonjs/index.js" attempted to import the Node standard library module "node:stream". It failed because the native React runtime does not include the Node standard library.

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

No branches or pull requests

4 participants