【发布时间】:2021-11-30 11:07:33
【问题描述】:
错误:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'path')
根据我的测试,
import { getStorage, ref, uploadBytesResumable, getDownloadURL }
from "https://www.gstatic.com/firebasejs/9.1.1/firebase-storage.js";
import { getDatabase, set, child, get, update, remove }
from "https://www.gstatic.com/firebasejs/9.1.1/firebase-database.js";
const realdb = getDatabase();
错误是因为 firebase-storage 中的 ref( ) 函数不同于 firebase-databaseref( ) /strong>
但是我只能导入其中一个函数,那该怎么办? 保存 downloadURL 我需要 (firebase-storage) 和 (firebase-database)。
【问题讨论】:
标签: javascript firebase firebase-realtime-database firebase-storage