4

My Google Cloud Function won't upload if I include this line, which came from the docs:

const {Translate} = require('@google-cloud/translate').v2;

The error is

TypeError: Cannot read property 'Reader' of undefined

There's no Reader in my code.

My version is:

npm -v @google-cloud/translate
6.14.10

Which is odd, because the current npm version is 6.0.5, and the release notes say there hasn't been an update since March 2020.

I tried both Node 10 and Node 12 for the Firebase Cloud Functions engine, same error.

Am I getting this error because I'm on the event horizon of a black hole and downloaded a future version of @google-cloud/translate? I think I might be in an alternative universe, 2020 was awful. How are things in your universe?

Thomas David Kehoe
  • 10,040
  • 14
  • 61
  • 100

1 Answers1

4

I updated the npm modules in my /functions directory and the error message is gone. Both firebase-functions and @google-cloud/translate were out of date.

Thomas David Kehoe
  • 10,040
  • 14
  • 61
  • 100