How do I debug with visual studio code firebase-database trigger functions? I tried the emulator, but I get an error when I call this
functions debug myMethod
C:\functions\functions>functions debug createUserChat
ERROR: Error: Function myMethod in location us-central1 in project myProject does not exist
at C:\Users\Dev\AppData\Roaming\npm\node_modules\@google-cloud\functions-emulator\node_modules\grpc\src\client.js:554:15
This code I want to debug
require('@google-cloud/debug-agent').start({ allowExpressions: true });;
const functions = require('firebase-functions'),
admin = require('firebase-admin'),
logging = require('@google-cloud/logging')();
admin.initializeApp(functions.config().firebase);
exports.myMethod= functions.database.ref('Tasks/{taskID}/taskStatus').onUpdate(event =>{
// do sth.
});
this is my launch file
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Function",
"type": "node",
"request": "attach",
"port": 5858
}
]
}