googleapis / nodejs-speech

This repository is deprecated. All of its content and history has been moved to googleapis/google-cloud-node.
https://cloud.google.com/speech/
Apache License 2.0
689 stars 291 forks source link

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

Closed noahvstephenson closed 1 year ago

noahvstephenson commented 2 years ago

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

Environment details

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');
ivanmkc commented 2 years ago

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

nicain commented 2 years ago

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

yil532 commented 2 years ago

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

alexander-fenster commented 2 years ago

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.