Skip to content
New issue

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

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

Already on GitHub? # to your account

TypeError: gcs is not a function error occurs when trying to use Google Cloud Storage as a datastore #199

Open
myoshibe opened this issue Mar 24, 2021 · 1 comment

Comments

@myoshibe
Copy link

Hi, I encountered an error which indicates that gcs is no longer a function when trying to leverage with Google Cloud Storage (gcs).

⚠️ : TypeError: gcs is not a function

From my quick investigation, you can fix it replacing the codes like below for the time being:

https://github.com/looker/lookerbot/blob/master/src/stores/google_cloud_store.ts

in line 5

// const gcs = require("@google-cloud/storage")
const {Storage} = require("@google-cloud/storage")

in line 19

    // const storage = gcs({
    // credentials: process.env.GOOGLE_CLOUD_CREDENTIALS_JSON ? JSON.pa
rse(process.env.GOOGLE_CLOUD_CREDENTIALS_JSON) : undefined,
    // projectId: process.env.GOOGLE_CLOUD_PROJECT,
    // })
    const storage = new Storage({
      credentials: process.env.GOOGLE_CLOUD_CREDENTIALS_JSON ? JSON.par
se(process.env.GOOGLE_CLOUD_CREDENTIALS_JSON) : undefined,
      projectId: process.env.GOOGLE_CLOUD_PROJECT,
    })

Since I'm not sure this could be a permanent measure, just allow me to leave an issue instead of PR.

@paiwandkarem
Copy link

paiwandkarem commented Jul 5, 2022

Still have this error on my end via a heroku deployment.

Can functionality be confirmed?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants