nodejs-speech icon indicating copy to clipboard operation
nodejs-speech copied to clipboard

The package at "node_modules\@google-cloud\speech\build\src\helpers.js" attempted to import the Node standard library module "stream"

Open noahvstephenson opened this issue 3 years ago • 4 comments

When adding @google-cloud/speech to a fresh React Native project with Expo, I am unable to implement it.

Environment details

  • OS: Windows 10
  • Node.js version: v16.14.0
  • npm version: 8.3.1
  • @google-cloud/speech version: 4.10.2

Steps to reproduce:

  1. Create new project using expo init
  2. Install @google-cloud/speech using npm install @google-cloud/speech
  3. Error occurs when when using const speech = require('@google-cloud/speech');

noahvstephenson avatar May 18 '22 17:05 noahvstephenson

And what is the error? Please post the full stack trace.

ivanmkc avatar Jun 16 '22 20:06 ivanmkc

@noahvstephenson Can you please provide a full stack trace, so we can assist you?

nicain avatar Jun 28 '22 15:06 nicain

Still waiting for the full stack trace. Thank you team!

yil532 avatar Jul 13 '22 02:07 yil532

This is a Node.js library, we don't officially support other environments. It's expected that it won't work if Node.js modules are not available.

Having that said, the module might work in non-Node environments such as browser, but you might need to tweaks configs for webpack or whatever other bundler you use, if any, to ignore Node-specific things like stream. Note that you might need to pass {fallback: 'rest'} to the client constructor, and you might need to change the way how you authenticate. If you need help setting this up, please open a separate issue; we don't support this use case but can try to help make it work on a best effort basis.

alexander-fenster avatar Oct 04 '22 18:10 alexander-fenster