Gowtham Sundar
Gowtham Sundar

Reputation: 31

Cannot invoke an expression whose type lacks a call signature when importing google-cloud/storage

So I have been trying to import google-cloud/storage in typescript(shown in image) and it keeps giving me that error. Doing const gcs = Storage; doesn't throw and error, but I am not sure this is an actual solution.

Error message

enter image description here

Upvotes: 3

Views: 682

Answers (1)

Matt McCutchen
Matt McCutchen

Reputation: 30919

A quick look at the declaration file ("go to definition" on '@google-cloud/storage') suggests that the correct usage pattern is the following:

import { Storage } from '@google-cloud/storage';
const gcs = new Storage();

Upvotes: 9

Related Questions