Open petermenocal opened 2 years ago
I finally got an error. It seems the sdk thinks firebase-admin is client-side still even though it is not:
[Error [FlamelinkError]:
The Firebase client-side SDK cannot access the Storage Bucket server-side.
Please use the admin SDK instead - https://www.npmjs.com/package/firebase-admin
Instructions here: https://flamelink.github.io/flamelink-js-sdk/#/getting-started?id=usage
] {
code: 'service-unavailable',
showStackTrace: false
}
relevant code from file:
var express = require("express");
var router = express.Router();
var firebaseApp = require("firebase-admin");
var flamelink = require("flamelink");
var serviceAccount = require("../firebase-adminsdk.json");
firebaseApp.initializeApp({
credential: firebaseApp.credential.cert(serviceAccount),
databaseURL: "...",
storageBucket: "...",
});
const app = flamelink({
firebaseApp,
dbType: "rtdb",
});
router.post("/", function (req, res, next) {
app.content
.get({
schemaKey: "product",
populate: ["image"],
})
.then((x) => console.log(x))
.catch((e) => console.log(e));
res.send(200);
});
module.exports = router;
Hi @petermenocal, which version of the Firebase admin SDK are you using?
1.0.0-alpha.34
Thanks that looks like the Flamelink SDK version, but would like to see if it is related to the Firebase SDK version (not the Flamelink SDK)
Could you potentially try the following for me please
replace
var flamelink = require("flamelink");
with
var flamelink = require("flamelink/app");
require("flamelink/content");
require("flamelink/storage");
Populate is not working as expected on 1.0.0-alpha.34 I have a simple image field in my schema. when I set
populate: true
orpopulate: ["image"]
on eitherapp.content.get()
orapp.content.getByField()
I return no results. If I removepopulate: true
and all variations, the proper result is returned.