Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Storage is not a constructor #731

Closed
ChariseWalraven opened this issue Sep 6, 2018 · 2 comments
Closed

TypeError: Storage is not a constructor #731

ChariseWalraven opened this issue Sep 6, 2018 · 2 comments

Comments

@ChariseWalraven
Copy link

ChariseWalraven commented Sep 6, 2018

When following the tutorial here, I get a console error TypeError: Storage is not a constructor

When I replace the code with this, however

const storage = new Storage.Storage();

it works.

I am on MacOS, and am trying to set up cloud functions. My node version is 10.9.0.

If you need any more info, feel free to ask me and I'll send it 👍

@fhinkel
Copy link
Contributor

fhinkel commented Oct 19, 2018

Thanks for raising the issue. We updated the tutorial.

const {Storage} = require('@google-cloud/storage');.

@fhinkel fhinkel closed this as completed Oct 19, 2018
@kaygeeklaas
Copy link

I am on windows and i'm also getting the same error.

firebase-tools :6.0.0
google-cloud/storage: 2.2.0

const functions = require('firebase-functions');
const cors=require("cors")({origin:true})
const fs=require("fs");
const UUID=require("uuid");
const {Storage}=require("@google-cloud/storage");

const gcs = new Storage({
  projectId:"my-project-id",
  keyFileName:"project.json"
})

i tried to this const gcs=new Storage() but still gives me the Storage is not a constructor error

ace-n pushed a commit that referenced this issue Nov 14, 2022
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this issue Nov 21, 2022
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
ace-n pushed a commit that referenced this issue Nov 21, 2022
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants