question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vision.ImageAnnotatorClient is not a constructor?

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
squarenotchcommented, Jan 10, 2018

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 read const client = new vision.v1.ImageAnnotatorClient({});

There are many, many differing documents online about this library but none of them said to use the above.

0reactions
JustinBeckwithcommented, Sep 11, 2018

Greetings @sandrapavankumar! Can you please open a new issue, with:

  • The version of the library you’re using
  • The exact code you’re using to instantiate the client

Thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found