Reputation: 426
I am new to firebase function and trying to use firebase function with Realtime database (Emulator suite).But when i try to set the value in firebase using the firebase function,it gives an error and doesn't set the value in database.
Error:
17:33:14
I
function[us-central1-textToLength]
[2021-11-05T12:03:14.194Z] @firebase/database: FIREBASE WARNING: wss:// URL used, but browser isn't known to support websockets. Trying anyway.
17:34:18
I
function[us-central1-textToLength]
[2021-11-05T12:04:18.762Z] @firebase/database: FIREBASE WARNING: wss:// URL used, but browser isn't known to support websockets. Trying anyway.
17:35:06
I
function[us-central1-textToLength]
[2021-11-05T12:05:06.473Z] @firebase/database: FIREBASE WARNING: wss:// URL used, but browser isn't known to support websockets. Trying anyway.
17:35:54
I
function[us-central1-textToLength]
[2021-11-05T12:05:54.409Z] @firebase/database: FIREBASE WARNING: wss:// URL used, but browser isn't known to support websockets. Trying anyway.
firebase function code :
const functions = require('firebase-functions');
var admin = require("firebase-admin");
admin.initializeApp();
var database = admin.database();
exports.helloWorld = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
});
exports.textToLength = functions.https.onRequest((request, response) => {
var tex = request.query.text;
var textLength = tex.length;
console.log(textLength);
database.ref().child('test').set("op");
response.send(String(textLength));
});
dependencies :
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase emulators:start --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"engines": {
"node": "14"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^9.8.0",
"firebase-functions": "^3.14.1",
"@firebase/database-compat": "0.1.2"
},
"devDependencies": {
"firebase-functions-test": "^0.2.0"
},
"private": true
}
npm installed packages
+-- @firebase/[email protected]
| +-- @firebase/[email protected]
| | +-- @firebase/[email protected]
| | | +-- @firebase/[email protected] deduped
| | | `-- [email protected] deduped
| | +-- @firebase/[email protected]
| | | `-- [email protected] deduped
| | +-- @firebase/[email protected]
| | | `-- [email protected] deduped
| | `-- [email protected] deduped
| +-- @firebase/[email protected]
| | +-- @firebase/[email protected] deduped
| | `-- [email protected] deduped
| +-- @firebase/[email protected]
| | `-- [email protected] deduped
| +-- @firebase/[email protected]
| | `-- [email protected] deduped
| `-- [email protected]
+-- @firebase/[email protected]
| +-- @firebase/[email protected]
| | +-- @firebase/[email protected] deduped
| | `-- [email protected] deduped
| +-- @firebase/[email protected]
| | +-- @firebase/[email protected]
| | +-- @firebase/[email protected] deduped
| | +-- @firebase/[email protected] deduped
| | +-- @firebase/[email protected] deduped
| | +-- [email protected]
| | | `-- [email protected]
| | | +-- [email protected]
| | | +-- [email protected] deduped
| | | `-- [email protected]
| | `-- [email protected] deduped
| +-- @firebase/[email protected]
| | +-- @firebase/[email protected]
| | `-- @firebase/[email protected] deduped
| +-- @firebase/[email protected]
| | `-- [email protected] deduped
| +-- @firebase/[email protected]
| | `-- [email protected] deduped
| `-- [email protected] deduped
`-- [email protected]
+-- @firebase/[email protected] deduped
+-- @firebase/[email protected]
| `-- @firebase/[email protected]
+-- @google-cloud/[email protected]
| +-- [email protected]
| +-- [email protected]
| +-- [email protected]
Upvotes: 15
Views: 1730
Reputation: 426
In the meantime, if you are on the latest Admin SDK version, you can pin @firebase/database-compat to version 0.1.2 in your package.json file as a temporary fix.
"dependencies": { "@firebase/database-compat": "0.1.2" }
This works for me.
Ref: https://github.com/firebase/firebase-admin-node/issues/1487
I referred this example and it worked but for this to work rebuild your package-lock.json file by removing node_modules folder and package_lock.json file and running npm install --package-lock-only
Upvotes: 5
Reputation: 21
Yes, definitely known issue currently they are working on a fix like Kasirajan suggested https://github.com/firebase/firebase-admin-node/issues/1487#issuecomment-962219551. This fix worked for us. Wanted to upvote his comment but my reputation is still low haha but I can verify that works.
Upvotes: 2
Reputation: 46
This issue seems to be caused from a recent release of one of the @firebase/* packages. I don't know exactly which version is bad yet, but I was able to resolve the issue by reverting my most recent change to my yarn.lock file.
Here are my current @firebase dependency versions, and I'm no longer experiencing the issue:
"@firebase/[email protected]":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@firebase/analytics-types/-/analytics-types-0.4.0.tgz#d6716f9fa36a6e340bc0ecfe68af325aa6f60508"
integrity sha512-Jj2xW+8+8XPfWGkv9HPv/uR+Qrmq37NPYT352wf7MvE9LrstpLVmFg3LqG6MCRr5miLAom5sen2gZ+iOhVDeRA==
"@firebase/[email protected]":
version "0.6.4"
resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.6.4.tgz#1e0c446e0045c94077f2d06ff3ba33e86d860398"
integrity sha512-Lhnk5pXeDKoPf1b2cggWQaqCtNq+jn6IkhHMIo+7VztVt3i8ovnGuhAn/0hLC+XxvVWJ9q6CXIoGStkwvecDoA==
dependencies:
"@firebase/analytics-types" "0.4.0"
"@firebase/component" "0.2.0"
"@firebase/installations" "0.4.20"
"@firebase/logger" "0.2.6"
"@firebase/util" "0.3.4"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.6.5"
resolved "https://registry.yarnpkg.com/@firebase/analytics/-/analytics-0.6.5.tgz#9f28575ba13e7f04cf1ae506322f11fb80bcb611"
integrity sha512-0yNdAtLRIS7wTs8eUSPHfQyypAbGha0MVpfnl18CTq1sLpdzHICn7CyCMYhc0ewlFdTCIHLjw4ZQoSTwtBHfkQ==
dependencies:
"@firebase/analytics-types" "0.4.0"
"@firebase/component" "0.2.1"
"@firebase/installations" "0.4.21"
"@firebase/logger" "0.2.6"
"@firebase/util" "0.4.0"
tslib "^2.0.0"
"@firebase/[email protected]":
version "0.6.1"
resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.6.1.tgz#dcbd23030a71c0c74fc95d4a3f75ba81653850e9"
integrity sha512-L/ZnJRAq7F++utfuoTKX4CLBG5YR7tFO3PLzG1/oXXKEezJ0kRL3CMRoueBEmTCzVb/6SIs2Qlaw++uDgi5Xyg==
"@firebase/[email protected]":
version "0.6.3"
resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.6.3.tgz#3f10514786aad846d74cd63cb693556309918f4b"
integrity sha512-/M13DPPati7FQHEQ9Minjk1HGLm/4K4gs9bR4rzLCWJg64yGtVC0zNg9gDpkw9yc2cvol/mNFxqTtd4geGrwdw==
"@firebase/[email protected]":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@firebase/app-types/-/app-types-0.7.0.tgz#c9e16d1b8bed1a991840b8d2a725fb58d0b5899f"
integrity sha512-6fbHQwDv2jp/v6bXhBw2eSRbNBpxHcd1NBF864UksSMVIqIyri9qpJB1Mn6sGZE+bnDsSQBC5j2TbMxYsJQkQg==
"@firebase/[email protected]":
version "0.6.15"
resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.6.15.tgz#a426f02eb7210d1ecc77d49296bbb1ec8481a791"
integrity sha512-VfULP09cci4xk+iAU6CB2CUNU/vbpAOoUleDdspXFphV9Yw36anb8RjaHGcN1DRR7LNb7vznNJXHk8FJhC8VWQ==
dependencies:
"@firebase/app-types" "0.6.1"
"@firebase/component" "0.2.0"
"@firebase/logger" "0.2.6"
"@firebase/util" "0.3.4"
dom-storage "2.1.0"
tslib "^1.11.1"
xmlhttprequest "1.8.0"
"@firebase/[email protected]":
version "0.6.16"
resolved "https://registry.yarnpkg.com/@firebase/app/-/app-0.6.16.tgz#d87f3d70e59dd44e8f14fd45a575b8ffe58be406"
integrity sha512-QGqfvDQ4AK54y2ysttdgtTsyuLGfN0OksdmWSHLDs7HBJg9nJkZUuFA/cJ1cftpPSVxpCbnro+OU1FtRgapzAA==
dependencies:
"@firebase/app-types" "0.6.1"
"@firebase/component" "0.2.1"
"@firebase/logger" "0.2.6"
"@firebase/util" "0.4.0"
dom-storage "2.1.0"
tslib "^2.0.0"
xmlhttprequest "1.8.0"
"@firebase/[email protected]":
version "0.1.5"
resolved "https://registry.yarnpkg.com/@firebase/auth-interop-types/-/auth-interop-types-0.1.5.tgz#9fc9bd7c879f16b8d1bb08373a0f48c3a8b74557"
integrity sha512-88h74TMQ6wXChPA6h9Q3E1Jg6TkTHep2+k63OWg3s0ozyGVMeY+TTOti7PFPzq5RhszQPQOoCi59es4MaRvgCw==
"@firebase/[email protected]":
version "0.1.6"
resolved "https://registry.yarnpkg.com/@firebase/auth-interop-types/-/auth-interop-types-0.1.6.tgz#5ce13fc1c527ad36f1bb1322c4492680a6cf4964"
integrity sha512-etIi92fW3CctsmR9e3sYM3Uqnoq861M0Id9mdOPF6PWIg38BXL5k4upCNBggGUpLIS0H1grMOvy/wn1xymwe2g==
"@firebase/[email protected]":
version "0.10.2"
resolved "https://registry.yarnpkg.com/@firebase/auth-types/-/auth-types-0.10.2.tgz#3fad953380c447b7545122430a4c7a9bc8355001"
integrity sha512-0GMWVWh5TBCYIQfVerxzDsuvhoFpK0++O9LtP3FWkwYo7EAxp6w0cftAg/8ntU1E5Wg56Ry0b6ti/YGP6g0jlg==
"@firebase/[email protected]":
version "0.16.4"
resolved "https://registry.yarnpkg.com/@firebase/auth/-/auth-0.16.4.tgz#6249d80f1e974b0db122930ae9fac885eccead5c"
integrity sha512-zgHPK6/uL6+nAyG9zqammHTF1MQpAN7z/jVRLYkDZS4l81H08b2SzApLbRfW/fmy665xqb5MK7sVH0V1wsiCNw==
dependencies:
"@firebase/auth-types" "0.10.2"
"@firebase/[email protected]":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.2.0.tgz#9d48327b3377b84ef22266ec6ab13416ea174c0a"
integrity sha512-QJJxMEzLRMWjujPBrrS32BScg1wmdY/dZWR8nAEzyC8WKQsNevYR9ZKLbBYxaN0umH9yf5C40kwmy+gI8jStPw==
dependencies:
"@firebase/util" "0.3.4"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.2.1.tgz#998e2909f87993a2ad7ea718dbf109cd8f5c7ca3"
integrity sha512-WfBFABfKYcRFjgMA7ydPLokSa+GkuZd+FD00KrZLAfslpHxs6cCFXdklvP8NEb1oDLqYakRXBqWdelH9/Whacg==
dependencies:
"@firebase/util" "0.4.0"
tslib "^2.0.0"
"@firebase/[email protected]":
version "0.5.7"
resolved "https://registry.yarnpkg.com/@firebase/component/-/component-0.5.7.tgz#a50c5fbd14a2136a99ade6f59f53498729c0f174"
integrity sha512-CiAHUPXh2hn/lpzMShNmfAxHNQhKQwmQUJSYMPCjf2bCCt4Z2vLGpS+UWEuNFm9Zf8LNmkS+Z+U/s4Obi5carg==
dependencies:
"@firebase/util" "1.4.0"
tslib "^2.1.0"
"@firebase/database-compat@^0.1.1":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@firebase/database-compat/-/database-compat-0.1.1.tgz#9fe69e3bd3f71d29011bb6ca793f38edb65ca536"
integrity sha512-K3DFWiw0YkLZtlfA9TOGPw6zVXKu5dQ1XqIGztUufFVRYW8IizReXVxzSSmJNR4Adr2LiU9j66Wenc6e5UfwaQ==
dependencies:
"@firebase/component" "0.5.7"
"@firebase/database" "0.12.1"
"@firebase/database-types" "0.9.1"
"@firebase/logger" "0.3.0"
"@firebase/util" "1.4.0"
tslib "^2.1.0"
"@firebase/[email protected]":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.7.0.tgz#ab140d178ded676e60d8ade8c8f13de8e01e7e1e"
integrity sha512-FduQmPpUUOHgbOt7/vWlC1ntSLMEqqYessdQ/ODd7RFWm53iVa0T1mpIDtNwqd8gW3k7cajjSjcLjfQGtvLGDg==
dependencies:
"@firebase/app-types" "0.6.1"
"@firebase/[email protected]":
version "0.9.1"
resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.9.1.tgz#0cab989e8154d812b535d80f23c1578b1d391f5f"
integrity sha512-RUixK/YrbpxbfdE+nYP0wMcEsz1xPTnafP0q3UlSS/+fW744OITKtR1J0cMRaXbvY7EH0wUVTNVkrtgxYY8IgQ==
dependencies:
"@firebase/app-types" "0.7.0"
"@firebase/util" "1.4.0"
"@firebase/database-types@^0.7.2":
version "0.7.3"
resolved "https://registry.yarnpkg.com/@firebase/database-types/-/database-types-0.7.3.tgz#819f16dd4c767c864b460004458620f265a3f735"
integrity sha512-dSOJmhKQ0nL8O4EQMRNGpSExWCXeHtH57gGg0BfNAdWcKhC8/4Y+qfKLfWXzyHvrSecpLmO0SmAi/iK2D5fp5A==
dependencies:
"@firebase/app-types" "0.6.3"
"@firebase/[email protected]":
version "0.12.1"
resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.12.1.tgz#7e43f27ac4057858d5bd0dd371b134b304fecdb0"
integrity sha512-Ethk0hc476qnkSKNBa+8Yc7iM8AO69HYWsaD+QUC983FZtnuMyNLHtEeSUbLQYvyHo7cOjcc52slop14WmfZeQ==
dependencies:
"@firebase/auth-interop-types" "0.1.6"
"@firebase/component" "0.5.7"
"@firebase/logger" "0.3.0"
"@firebase/util" "1.4.0"
faye-websocket "0.11.4"
tslib "^2.1.0"
"@firebase/[email protected]":
version "0.9.4"
resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.9.4.tgz#7f108ad96f099beae78c06a86f81edf4302fd4c4"
integrity sha512-Fw2bA4OyxAMqLy8xtoZKlUAuDWjjH/z4AInRTAzHxgegXDbu0UK+VM0pmY44RuM2cmnVY4aW6xLXAdDKTY1aJQ==
dependencies:
"@firebase/auth-interop-types" "0.1.5"
"@firebase/component" "0.2.0"
"@firebase/database-types" "0.7.0"
"@firebase/logger" "0.2.6"
"@firebase/util" "0.3.4"
faye-websocket "0.11.3"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.9.5"
resolved "https://registry.yarnpkg.com/@firebase/database/-/database-0.9.5.tgz#3f4f1dac759d138cf7cfaef5121640cba506f700"
integrity sha512-sfS5ZvU7UqztMAP9y3t/AQRNhqDrHJT6/W1JBmEivjSxf1MLLbCafZMFbksuvl2iog73wOGDuoDzSHvhtSQvvg==
dependencies:
"@firebase/auth-interop-types" "0.1.5"
"@firebase/component" "0.2.1"
"@firebase/database-types" "0.7.0"
"@firebase/logger" "0.2.6"
"@firebase/util" "0.4.0"
faye-websocket "0.11.3"
tslib "^2.0.0"
"@firebase/[email protected]":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-2.1.0.tgz#ad406c6fd7f0eae7ea52979f712daa0166aef665"
integrity sha512-jietErBWihMvJkqqEquQy5GgoEwzHnMXXC/TsVoe9FPysXm1/AeJS12taS7ZYvenAtyvL/AEJyKrRKRh4adcJQ==
"@firebase/[email protected]":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@firebase/firestore-types/-/firestore-types-2.2.0.tgz#9a3f3f2906232c3b4a726d988a6ef077f35f9093"
integrity sha512-5kZZtQ32FIRJP1029dw+ZVNRCclKOErHv1+Xn0pw/5Fq3dxroA/ZyFHqDu+uV52AyWHhNLjCqX43ibm4YqOzRw==
"@firebase/[email protected]":
version "2.1.7"
resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-2.1.7.tgz#039d1d469bd14d89a2d091ec7887a92cc7ab11a7"
integrity sha512-sh+aX6udS8a+rwmlJO4zJwvoMC1D2x1CiPvj0nFYWhILRKWvztk/bOA3lT2FWcHY4kr/7x+CnqfwtiOSaufdNQ==
dependencies:
"@firebase/component" "0.2.0"
"@firebase/firestore-types" "2.1.0"
"@firebase/logger" "0.2.6"
"@firebase/util" "0.3.4"
"@firebase/webchannel-wrapper" "0.4.1"
"@grpc/grpc-js" "^1.0.0"
"@grpc/proto-loader" "^0.5.0"
node-fetch "2.6.1"
tslib "^1.11.1"
"@firebase/[email protected]":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@firebase/firestore/-/firestore-2.2.0.tgz#b7cf2d6a65b432bec43430f1d9f696c07b881e90"
integrity sha512-/p0oR73zgAlEHgqCIt5v2m8ADOign6APkZ0QG5bJQVSDqPXjB89ktI3v8x0qtRtzKm/pd3lmyoD/raOh/ItsZA==
dependencies:
"@firebase/component" "0.2.1"
"@firebase/firestore-types" "2.2.0"
"@firebase/logger" "0.2.6"
"@firebase/util" "0.4.0"
"@firebase/webchannel-wrapper" "0.4.1"
"@grpc/grpc-js" "^1.0.0"
"@grpc/proto-loader" "^0.5.0"
node-fetch "2.6.1"
tslib "^2.0.0"
"@firebase/[email protected]":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@firebase/functions-types/-/functions-types-0.4.0.tgz#0b789f4fe9a9c0b987606c4da10139345b40f6b9"
integrity sha512-3KElyO3887HNxtxNF1ytGFrNmqD+hheqjwmT3sI09FaDCuaxGbOnsXAXH2eQ049XRXw9YQpHMgYws/aUNgXVyQ==
"@firebase/[email protected]":
version "0.6.2"
resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.6.2.tgz#5ed6822248c14a4287ec156afc980d76d57e470a"
integrity sha512-f+NxRd0k5RBPZUPj8lykeNMku8TpJTgZaRd3T6cXb8HbmSg/VY7uxQSGOXe11X2gSv/TvcwTQttViFzRMDs7CQ==
dependencies:
"@firebase/component" "0.2.0"
"@firebase/functions-types" "0.4.0"
"@firebase/messaging-types" "0.5.0"
node-fetch "2.6.1"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.6.3"
resolved "https://registry.yarnpkg.com/@firebase/functions/-/functions-0.6.3.tgz#015e1efd1cf6749dddbdc056215d3035b43d000c"
integrity sha512-02dqjin4V9PvuZLU6d14azyRZZ5cUSPT5CvE2SbGjAcXYdlFIg5Cy6T50dl48UsbmmNO40kXNB1dGESp2A4cWw==
dependencies:
"@firebase/component" "0.2.1"
"@firebase/functions-types" "0.4.0"
"@firebase/messaging-types" "0.5.0"
node-fetch "2.6.1"
tslib "^2.0.0"
"@firebase/[email protected]":
version "0.3.4"
resolved "https://registry.yarnpkg.com/@firebase/installations-types/-/installations-types-0.3.4.tgz#589a941d713f4f64bf9f4feb7f463505bab1afa2"
integrity sha512-RfePJFovmdIXb6rYwtngyxuEcWnOrzdZd9m7xAW0gRxDIjBT20n3BOhjpmgRWXo/DAxRmS7bRjWAyTHY9cqN7Q==
"@firebase/[email protected]":
version "0.4.20"
resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.4.20.tgz#e52a5904c41ac0be0bb2ab1e320b8e1018ed2630"
integrity sha512-ddUPZQKHWJzqg3g11hxHIPhp3oMEmsPo0GSxtp9Xd2VLRU64MFNAAt5PiBbq1K92ukZVoNh6Ki6J6+hJEQcGQw==
dependencies:
"@firebase/component" "0.2.0"
"@firebase/installations-types" "0.3.4"
"@firebase/util" "0.3.4"
idb "3.0.2"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.4.21"
resolved "https://registry.yarnpkg.com/@firebase/installations/-/installations-0.4.21.tgz#152fae36647eb08c1e94f94ca160d3273a401117"
integrity sha512-tMoAb1lHAQefdknWbKxSp2CEWWV/f4aeq4PjhzWurJEJN4RQ620ITbtuKregnGnYHu9lDzhyZ51H4s6+BhjCxA==
dependencies:
"@firebase/component" "0.2.1"
"@firebase/installations-types" "0.3.4"
"@firebase/util" "0.4.0"
idb "3.0.2"
tslib "^2.0.0"
"@firebase/[email protected]":
version "0.2.6"
resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.2.6.tgz#3aa2ca4fe10327cabf7808bd3994e88db26d7989"
integrity sha512-KIxcUvW/cRGWlzK9Vd2KB864HlUnCfdTH0taHE0sXW5Xl7+W68suaeau1oKNEqmc3l45azkd4NzXTCWZRZdXrw==
"@firebase/[email protected]":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@firebase/logger/-/logger-0.3.0.tgz#a3992e40f62c10276dbfcb8b4ab376b7e25d7fd9"
integrity sha512-7oQ+TctqekfgZImWkKuda50JZfkmAKMgh5qY4aR4pwRyqZXuJXN1H/BKkHvN1y0S4XWtF0f/wiCLKHhyi1ppPA==
dependencies:
tslib "^2.1.0"
"@firebase/[email protected]":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@firebase/messaging-types/-/messaging-types-0.5.0.tgz#c5d0ef309ced1758fda93ef3ac70a786de2e73c4"
integrity sha512-QaaBswrU6umJYb/ZYvjR5JDSslCGOH6D9P136PhabFAHLTR4TWjsaACvbBXuvwrfCXu10DtcjMxqfhdNIB1Xfg==
"@firebase/[email protected]":
version "0.7.4"
resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.7.4.tgz#d527506de7690731f0a83e6a82a6aa590b14523a"
integrity sha512-xIZ1vHnOcHAaj+H/gS8tu3QolR9up+fyTfgVLEFbZRsbAiLuIvuaoJwTHLAUTs/nJF6GtEGscRD4Jx/aFmEJRw==
dependencies:
"@firebase/component" "0.2.0"
"@firebase/installations" "0.4.20"
"@firebase/messaging-types" "0.5.0"
"@firebase/util" "0.3.4"
idb "3.0.2"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.7.5"
resolved "https://registry.yarnpkg.com/@firebase/messaging/-/messaging-0.7.5.tgz#1efe40b1785535ee13af323b7f2deb7cceb2a94a"
integrity sha512-jA1pdV/DrfvzSVKLuff2hYo2AvU0CdZ901TngxscJqKYViZEoqAGw2v/kC70uRwEG0Tc2M/SRHstHpeFADlP0Q==
dependencies:
"@firebase/component" "0.2.1"
"@firebase/installations" "0.4.21"
"@firebase/messaging-types" "0.5.0"
"@firebase/util" "0.4.0"
idb "3.0.2"
tslib "^2.0.0"
"@firebase/[email protected]":
version "0.0.13"
resolved "https://registry.yarnpkg.com/@firebase/performance-types/-/performance-types-0.0.13.tgz#58ce5453f57e34b18186f74ef11550dfc558ede6"
integrity sha512-6fZfIGjQpwo9S5OzMpPyqgYAUZcFzZxHFqOyNtorDIgNXq33nlldTL/vtaUZA8iT9TT5cJlCrF/jthKU7X21EA==
"@firebase/[email protected]":
version "0.4.6"
resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.4.6.tgz#e6b8b4c7c21e657af3a8e87c422cd4d199b57fa1"
integrity sha512-fy9YPYnvePFxme7euyi8B658gF8JUQhAB1qv6hVw+HqjVZQIANhwM9AUBi9+5jikD7gD1CnU7EjREvoy8MJiAw==
dependencies:
"@firebase/component" "0.2.0"
"@firebase/installations" "0.4.20"
"@firebase/logger" "0.2.6"
"@firebase/performance-types" "0.0.13"
"@firebase/util" "0.3.4"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.4.7"
resolved "https://registry.yarnpkg.com/@firebase/performance/-/performance-0.4.7.tgz#be201b76667f59aabd31e7fb73977ed5b172d0c3"
integrity sha512-wxau4qrAy5W+kIoXPUm5hJVX4+vY3wVC9QqWNzoqb+L5tMHxIoeEqxvJo8abjv4pa0/YaVl1XKAZdvvoe7c/dA==
dependencies:
"@firebase/component" "0.2.1"
"@firebase/installations" "0.4.21"
"@firebase/logger" "0.2.6"
"@firebase/performance-types" "0.0.13"
"@firebase/util" "0.4.0"
tslib "^2.0.0"
"@firebase/[email protected]":
version "0.3.36"
resolved "https://registry.yarnpkg.com/@firebase/polyfill/-/polyfill-0.3.36.tgz#c057cce6748170f36966b555749472b25efdb145"
integrity sha512-zMM9oSJgY6cT2jx3Ce9LYqb0eIpDE52meIzd/oe/y70F+v9u1LDqk5kUF5mf16zovGBWMNFmgzlsh6Wj0OsFtg==
dependencies:
core-js "3.6.5"
promise-polyfill "8.1.3"
whatwg-fetch "2.0.4"
"@firebase/[email protected]":
version "0.1.9"
resolved "https://registry.yarnpkg.com/@firebase/remote-config-types/-/remote-config-types-0.1.9.tgz#fe6bbe4d08f3b6e92fce30e4b7a9f4d6a96d6965"
integrity sha512-G96qnF3RYGbZsTRut7NBX0sxyczxt1uyCgXQuH/eAfUCngxjEGcZQnBdy6mvSdqdJh5mC31rWPO4v9/s7HwtzA==
"@firebase/[email protected]":
version "0.1.31"
resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.1.31.tgz#092cefc946558a1924d34960163f19b1adf8253d"
integrity sha512-QWjDsrLSqQnq/YTb3TSOJtIv7z2GXB7mTiwXE43NxYmsOX2z8KBlBBEHf9TcWk+90MKUTFfurDgYJN4rlIOxPg==
dependencies:
"@firebase/component" "0.2.0"
"@firebase/installations" "0.4.20"
"@firebase/logger" "0.2.6"
"@firebase/remote-config-types" "0.1.9"
"@firebase/util" "0.3.4"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.1.32"
resolved "https://registry.yarnpkg.com/@firebase/remote-config/-/remote-config-0.1.32.tgz#a3ffac5039b6a785d83bf5864b58b06fe0b8cfea"
integrity sha512-nPPhKSUHgwlv2hazke6keBkkadW+/VCpNbq3P9L8oWxq7hKQz7MYAC5LU6PqexNmWQqGFiYyX5J8XDUU3gH/NQ==
dependencies:
"@firebase/component" "0.2.1"
"@firebase/installations" "0.4.21"
"@firebase/logger" "0.2.6"
"@firebase/remote-config-types" "0.1.9"
"@firebase/util" "0.4.0"
tslib "^2.0.0"
"@firebase/[email protected]":
version "1.2.4"
resolved "https://registry.yarnpkg.com/@firebase/rules-unit-testing/-/rules-unit-testing-1.2.4.tgz#7c378f7f0e277cf84016946b6d6af269a439e25a"
integrity sha512-suYV3B3UaZS/+4x+94gAaAZTaYn7r3du5h4lYunvY4LAzimtv8sVFhxNvlfV3awDCJUoAMlh6MFAm7wg2rXJ4g==
dependencies:
"@firebase/logger" "0.2.6"
"@firebase/util" "0.4.0"
firebase "8.3.0"
request "2.88.2"
"@firebase/[email protected]":
version "0.3.13"
resolved "https://registry.yarnpkg.com/@firebase/storage-types/-/storage-types-0.3.13.tgz#cd43e939a2ab5742e109eb639a313673a48b5458"
integrity sha512-pL7b8d5kMNCCL0w9hF7pr16POyKkb3imOW7w0qYrhBnbyJTdVxMWZhb0HxCFyQWC0w3EiIFFmxoz8NTFZDEFog==
"@firebase/[email protected]":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.4.3.tgz#8800fa61131890f64448b4ab536c8ee1ba9bdcdf"
integrity sha512-53IIt6Z3BltPBPmvxF/RGlvW8nBl4wI9GMR52CjRAIj438tPNxbpIvkLB956VVB9gfZhDcPIKxg7hNtC7hXrkA==
dependencies:
"@firebase/component" "0.2.0"
"@firebase/storage-types" "0.3.13"
"@firebase/util" "0.3.4"
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.4.4"
resolved "https://registry.yarnpkg.com/@firebase/storage/-/storage-0.4.4.tgz#e1cca95706a1a25c551134b687be975fa4853a49"
integrity sha512-3mH6IR04Lvk16kQQ7CMumpppNcqN6RVcqSD3jzaB8P6vbzDVRyk7Dnhd00Eigd++q5FdNRpW3h8xGvHPWDYfKQ==
dependencies:
"@firebase/component" "0.2.1"
"@firebase/storage-types" "0.3.13"
"@firebase/util" "0.4.0"
tslib "^2.0.0"
"@firebase/[email protected]":
version "0.3.4"
resolved "https://registry.yarnpkg.com/@firebase/util/-/util-0.3.4.tgz#e389d0e0e2aac88a5235b06ba9431db999d4892b"
integrity sha512-VwjJUE2Vgr2UMfH63ZtIX9Hd7x+6gayi6RUXaTqEYxSbf/JmehLmAEYSuxS/NckfzAXWeGnKclvnXVibDgpjQQ==
dependencies:
tslib "^1.11.1"
"@firebase/[email protected]":
version "0.4.0"
resolved "https://registry.yarnpkg.com/@firebase/util/-/util-0.4.0.tgz#8db3d39e0ed7b991b4da2435d7e6556cb1bd6672"
integrity sha512-z8A+9YGM61ZXQ2KBSVwxXaELOJjG+EQ374YolqNVMvWBJzTNGZGaVP81Ggl8XD10Xinyt1Dgdo86JDV0OAnvqA==
dependencies:
tslib "^2.0.0"
"@firebase/[email protected]":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@firebase/util/-/util-1.4.0.tgz#81e985adba44b4d1f21ec9f5af9628d505891de8"
integrity sha512-Qn58d+DVi1nGn0bA9RV89zkz0zcbt6aUcRdyiuub/SuEvjKYstWmHcHwh1C0qmE1wPf9a3a+AuaRtduaGaRT7A==
dependencies:
tslib "^2.1.0"
"@firebase/[email protected]":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@firebase/webchannel-wrapper/-/webchannel-wrapper-0.4.1.tgz#600f2275ff54739ad5ac0102f1467b8963cd5f71"
integrity sha512-0yPjzuzGMkW1GkrC8yWsiN7vt1OzkMIi9HgxRmKREZl2wnNPOKo/yScTjXf/O57HM8dltqxPF6jlNLFVtc2qdw==
Upvotes: 0
Reputation: 109
In the meantime, if you are on the latest Admin SDK version, you can pin @firebase/database-compat to version 0.1.2 in your package.json file as a temporary fix.
"dependencies": { "@firebase/database-compat": "0.1.2" }
This works for me.
Ref: https://github.com/firebase/firebase-admin-node/issues/1487
Upvotes: 10
Reputation: 26171
I'm unsure as to the cause of that log message, but I do see that you are returning a response from your function before it completes all of its work. In a deployed function, as soon as the function returns, all further actions should be treated as if they will never be executed as documented here. An "inactive" function might be terminated at any time, is severely throttled and any network calls you make (like setting data in the RTDB) may never be executed.
I know you are new to this, but its a good habit to get into now: don't assume the person calling your function is you. Check for problems like missing query parameters and dodgy data before you blindly action something. The Admin SDK bypasses your database's security rules and if you are not careful a malicious user can cause some damage (e.g. a user that updates /users/$theirUid/roles/admin
to true
).
exports.textToLength = functions.https.onRequest((request, response) => {
const { text: queryText } = request.query;
if (!queryText)
return response.status(400).send("Missing ?text");
if (typeof queryText !== 'string')
return response.status(400).send("Bad value for ?text");
const textLength = queryText.length;
database.ref()
.child('test')
.set("op")
.then(() => {
console.log(`Successfully updated /test/op to ${textLength}`);
response.send(String(textLength))
})
.catch((err) => {
console.error(`Failed to update /test/op to ${textLength}: `, error);
response.status(500).send(`Failed to update database to ${textLength}`)
});
;
});
Note: When deploying HTTPS Request functions, don't forget to handle CORS.
Upvotes: 0