我正在按照在线教程使用 Firebase on React 构建社交媒体应用程序。
我发现非常令人困惑的是,当我创建新用户时,我可以访问存储桶,并从我在 Firebase 存储中上传的图片(使用存储桶端点)设置默认注册图像。
但是,当我尝试使用相同的存储桶端点和不同的图像文件发送 POST 请求来更新图像时,出现以下错误:
FirebaseError: Bucket name not specified or invalid. Specify a valid bucket name via the storageBucket option when initializing the app, or specify the bucket name explicitly when calling the getBucket() method.
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)at new FirebaseError (/Users/yousef/codeclan_work/run_dat/functions/node_modules/firebase-admin/lib/utils/error.js:42:28) at Storage.bucket (/Users/yousef/codeclan_work/run_dat/functions/node_modules/firebase-admin/lib/storage/storage.js:109:15) at Busboy.<anonymous> (/Users/yousef/codeclan_work/run_dat/functions/handlers/users.js:111:25) at Busboy.emit (events.js:209:13) at Busboy.emit (/Users/yousef/codeclan_work/run_dat/functions/node_modules/busboy/lib/main.js:37:33) at /Users/yousef/codeclan_work/run_dat/functions/node_modules/busboy/lib/types/multipart.js:52:13 at processTicksAndRejections (internal/process/task_queues.js:75:11) {
> errorInfo: {
> code: 'storage/invalid-argument',
> message: 'Bucket name not specified or invalid. …
Run Code Online (Sandbox Code Playgroud)