Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
475 views
in Technique[技术] by (71.8m points)

Google Cloud TypeError: Cannot read property 'Reader' of undefined

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?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...