firebase-admin-go icon indicating copy to clipboard operation
firebase-admin-go copied to clipboard

Error building - undefined: storage.CommonRequestParams

Open daveteu opened this issue 3 years ago • 1 comments
trafficstars

[REQUIRED] Step 2: Describe your environment

  • Operating System version: macOS
  • Firebase SDK version: admin
  • Library version: v4
  • Firebase Product: auth

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

New project with the following codes

package firebase

import (
	"context"
	"log"

	firebase "firebase.google.com/go/v4"
	"google.golang.org/api/option"
)

var Firebase *firebase.App

func Init() {

	opt := option.WithCredentialsFile("./......json")
	config := &firebase.Config{ProjectID: "[email protected]"}
	app, err := firebase.NewApp(context.Background(), config, opt)
	if err != nil {
		log.Fatalf("error initializing app: %v\n", err)
	}

	Firebase = app
}

Error encountered

# cloud.google.com/go/storage
../../../go/pkg/mod/cloud.google.com/go/[email protected]/writer.go:451:24: undefined: storage.CommonRequestParams
../../../go/pkg/mod/cloud.google.com/go/[email protected]/writer.go:453:23: undefined: storage.CommonRequestParams
../../../go/pkg/mod/cloud.google.com/go/[email protected]/writer.go:461:3: unknown field 'CommonRequestParams' in struct literal of type "google.golang.org/genproto/googleapis/storage/v2".StartResumableWriteRequest

PS: I am just using firebase admin for authentication, I do not have any codes that is using storage.

daveteu avatar Jun 27 '22 21:06 daveteu

This issue is related to https://github.com/googleapis/google-cloud-go/issues/6055

I'm not sure why firebase admin is bundled with 1.21.0 and no one is reporting the same error as me, but it can be resolved should we upgrade cloud.google.com/go ourself to 1.22.1 which is the version that fixed the bug.

Solution

go get cloud.google.com/go/[email protected]

daveteu avatar Jun 28 '22 04:06 daveteu

Thank you for reporting this issue. As the current version now points to cloud.google.com/go/storage v1.26.0 I am closing this issue. We can reopen later if needed.

lahirumaramba avatar Oct 17 '22 21:10 lahirumaramba