vision.ImageAnnotatorClient is not a constructor?
See original GitHub issueI am new to node.js and have struggled with the above error message for over 6 hours. Ive tried every example I can find on the web but always end up with an errr when trying to create a client object. Stripped down code as follows always results in the error in the title. Any help would be greatly appreciated. Thank you.
'use strict';
const path = require('path');
const gcs = require('@google-cloud/storage')();
const vision = require('@google-cloud/vision')();
exports.tagImage = (event) => {
const object = event.data;
const client = new vision.ImageAnnotatorClient();
};
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Vision is not a constructor · Issue #272 - GitHub
So, I implemented as thus which seems to work fine: import Vision from '@google-cloud/vision'; new Vision.ImageAnnotatorClient({ credentials: ...
Read more >Uncaught TypeError: gax.GoogleProtoFilesRoot is not a ...
But when I view what I get in my console, this is what I get: Uncaught TypeError: gax.GoogleProtoFilesRoot is not a constructor.
Read more >Class v1.ImageAnnotatorClient (3.0.1) | Node.js client library
This service will write image annotation outputs to json files in customer GCS bucket, each json file containing BatchAnnotateImagesResponse ...
Read more >ImageAnnotatorClient (Google Cloud 0.90.0-alpha API)
A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate...
Read more >com.google.cloud.vision.v1.ImageAnnotatorClient.<init> java ...
The channels are * created based on the settings passed in, or defaults for any settings that are not set. */ public static...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Got it working but wow are the docs out of date! The package.json file needs to have
"@google-cloud/vision": "0.14.0"
, and the index.js file should readconst client = new vision.v1.ImageAnnotatorClient({});
There are many, many differing documents online about this library but none of them said to use the above.
Greetings @sandrapavankumar! Can you please open a new issue, with:
Thanks!