Firebase功能已部署,但未显示在控制台中 [英] Firebase function deploying, but not showing up in console

查看:100
本文介绍了Firebase功能已部署,但未显示在控制台中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此问题与 44799104 ,只是我提供了index.js(而且唯一的答案没有帮助,因为我确实包含了"exports").

This question is essentially the same as question 44799104, only that I provide my index.js (and the only answer there was not helpful, as I do include 'exports').

简而言之,我已经成功部署了功能,

In short, I have deployed my function successfully,

,但不会显示在控制台中.我要去哪里错了? 这是我的index.js:

but it does not show in the console. Where am I going wrong? Here is my index.js:

const functions = require('firebase-functions');
const admin = require('firebase-admin');

admin.initializeApp(functions.config().firebase);

var delayInMilliseconds = 5000;


exports.copyRoom= functions.database.ref('/RoomsOwn/${AuthUid}').onWrite((event) => {

    var uid = event.params.AuthUid;
    console.log('AuthID: ' + uid);
    var object = event.data.val();
    console.log('Whole Object: ', object);

    setTimeout(function() {
    return admin.database.ref('/RoomsOthers/${uid}').set(object);
    }, delayInMilliseconds);

  });

推荐答案

运行firebase deploy时实际上并没有部署该功能.如果您成功部署了该功能,则该功能的名称将出现在Firebase CLI输出中.

You didn't actually deploy that function when you ran firebase deploy. If you had successfully deployed it, the name of the function would have appeared in the Firebase CLI output.

请确保您:

  1. 实际上已使用您要部署的功能保存了文件.
  2. 文件在正确的目录中.对于JavaScript项目,默认值为functions/index.js
  3. 正在从正确的目录中部署正确的项目.

这篇关于Firebase功能已部署,但未显示在控制台中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆