Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 142239

TypeError: Translate is not a function Google Cloud Translation API v5.0.1

$
0
0

I am unable to instantiate a translate object according to the documentation found here https://googleapis.dev/nodejs/translate/latest/index.html

I have looked at this question but the answers don't work - whether these are for legacy versions of cloud api or if they never worked as solutions I am unclear (TypeError: Translate is not a constructor)

a translation object should be created by simply

const { Translate } = require('@google-cloud/translate');
const translate = new Translate({projectId: <myprojectid>});

however this results in

TypeError: Translate is not a constructor

Viewing all articles
Browse latest Browse all 142239

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>