nextjs-gcp-storage icon indicating copy to clipboard operation
nextjs-gcp-storage copied to clipboard

Error with GCS not working on Vercel but working on Local?

Open AnKoderYadav opened this issue 1 year ago • 1 comments

I had tried various methods to set environmental variable (GCS credentials) but image upload to bucket is not working. But it works in local very well.

AnKoderYadav avatar Sep 20 '23 20:09 AnKoderYadav

use this setting instead

const storage = new Storage({
  projectId: process.env.GCP_PROJECT_ID,
  credentials: {
    type: 'service_account',
    private_key: process.env.GCS_PRIVATE_KEY,
    client_email: process.env.GCS_CLIENT_EMAIL,
    client_id: process.env.GCS_CLIENT_ID,
    universe_domain: process.env.GCS_UNIVERSE_DOMAIN,
  },
});

jaosn60810 avatar Dec 15 '23 01:12 jaosn60810