- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在index.ts中有 typescript 代码
import * as functions from "firebase-functions";
import * as cors from "cors";
cors({ origin: true });
exports.myFunc = functions.https.onCall((data, context) => {
const { uid } = context.auth;
return { uid };
});
如果我尝试部署此功能:
firebase deploy --only functions:myFunc
我回来了:
functions: the following filters were specified but do not match any functions in the project: myFunc
我做错了什么?
最佳答案
我发现了一个错误。 Typescript 编译目录 lib/functions/src/index.js
中的 .js 文件,但我的 package.json 文件具有主文件的外部路径
{
...
"main": "lib/index.js",
...
}
我改为
{
...
"main": "lib/functions/src/index.js",
...
}
成功了!
关于javascript - 为什么 firebase 函数 onCall 不部署?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53672861/
我想为一堆云函数编写一些单元测试。现在我面临以下问题。使用 firebase-functions-test我不知何故无法测试 HTTP 触发的云功能。以下是我想使用 jest 测试的一些云功能: ex
我正在使用 Google Cloud Functions Emulator用于在本地调试我的 Firebase 函数。Firebase 推荐使用 functions.https.onCall func
我正在尝试使用 firebase 作为我的 android 应用程序的后端。但在这个早期阶段,部署到谷歌服务器并测试每个新功能和每个修复都太慢了。 我想知道是否可以在本地运行它以便我的 android
在 this cypress example我发现 onCall() 方法似乎是“Sinon”,因为我发现它 here 。提到 Cypress 中支持的断言 here它包括 sinon-chai ,其
我正在尝试读取 Google Cloud Functions onCall 函数的返回值,但我一直读取 null。 这是我的 Angular 代码: const callable = this.ang
我正在测试一个非常简单的实现,如 FB 文档 (https://firebase.google.com/docs/functions/callable) 中所述,但它不起作用。 这是我的 Fireba
我构建了一些像这样的云函数: const addRoom = functions.https.onCall((data, context) => { 它工作得很好,但我想将区域更改为欧洲西部。我关注了
浏览文档,我遇到了: ...you can call functions directly with an HTTP request or a call from the client. ~ sour
这个问题在这里已经有了答案: How to use a value outside dataSnapshot function? (1 个回答) getContactsFromFirebase()
Firebase 函数 onCall 不起作用 我最近在关注 的 Firebase 教程系列。网络忍者 YouTube channel 。 The Net Ninja Firebase Functio
我刚刚升级为使用 Firebase Cloud Functions v1.x。根据this answer Callable functions are exactly the same as HTTP
我想通过 firebasefunctions:shell 作为经过身份验证的 usr 测试 onCall 函数 我已经尝试了许多来自 https://firebase.google.com/docs/
我似乎无法在 Firebase Documentation 中找到此问题的解决方案. 我想在本地测试我的 functions.https.onCall 函数。是否可以使用 shell 或以某种方式将我
我在index.ts中有 typescript 代码 import * as functions from "firebase-functions"; import * as cors from "c
用户在聊天客户端(网站)中键入一条消息。此消息将发送到在 firebase 上设置的云功能。云函数然后查询返回响应的第 3 方 API。此响应需要发送回客户端以显示。 所以基本上我的客户会像这样调用云
我的客户端代码仅调用该函数一次,但在服务器日志中它显示了两次单独的调用。每对中的第一个似乎并没有真正处理我的服务器端代码 - 这是预期的行为吗? onCall 函数: const functions
我有一个看起来像这样的 onCall 函数。 exports.getResults = functions.https.onCall((data, context) => { const admi
通过遵循 Firebase Docs 和 Stripe API Docs,我创建了一个函数,该函数根据传递的 token 创建费用。此函数是使用 Firebases onCall 函数设置的,以便能够
我正在尝试编写一些方法装饰器以在 typescript 中与 firebase 函数一起使用,但我对语法有点困惑,到目前为止我尝试过的方法没有用。 我想在我的类中有方法,例如: @OnCall('eu
我有以下用 node.js 编写的 firebase 云函数,我从 Android 应用程序调用该函数。该函数工作正常,但在尝试在 Android 中获取结果时得到 null。我需要返回到我的 And
我是一名优秀的程序员,十分优秀!