My Code is running perfectly fine in the test environment, but fails if I try to deploy
here is the log of the errors
Here is the code that is supposedly throwing the exception
export class Database {
static async get(key) {
return await fetch(FIREBASE_URL + encodeURIComponent(key) + "/.json?auth=" + FIREBASE_SECRET)
.then(e => e.text())
.then(value => {
if (!value) return null;
try { value = JSON.parse(value); }
catch { return null; }
if (value === undefined || value === null || value.error !== undefined) return null;
return value;
});
}
static async set(key, value) {
await fetch(FIREBASE_URL + encodeURIComponent(key) + "/.json?auth=" + FIREBASE_SECRET, {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(value),
});
}
static async delete(key) {
await fetch(
FIREBASE_URL + encodeURIComponent(key) + "/.json?auth=" + FIREBASE_SECRET,
{ method: "DELETE" }
);
}
static async dictionary() {
return await fetch(`${FIREBASE_URL}/.json?auth=${FIREBASE_SECRET}`)
.then(e => e.text())
.then(value => {
if (!value) return null;
try { value = JSON.parse(value); }
catch { return null; }
if (value === undefined || value === null || value.error !== undefined) return null;
return value;
});
}
}
the code works perfectly in test but the second i attempt to deploy it it fails. Any tips?