我正在使用TypeScript来实现firebase应用程序,根据,有四种方法可以初始化防火墙应用程序。
我在使用firebaseConfig对象时是成功的,但是使用“保留托管URL”,我似乎无法摆脱这条消息:Firebase: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() (app/no-app).
我要做的是:
import * as firebase from 'firebase/app';
import "firebase/data
如何在typescript中从文件导入类型?
这就是我正在做的,
我有一个主文件
import * as functions from "firebase-functions";
import * as util from "util";
import * as admin from "firebase-admin";
import Storage from "./{some-location}"
admin.initializeApp({
credential: admin.credential.cert("./.
我在云函数上使用了firebase云函数和javascript。而且,我想从javascript切换到typescript。
但是,我不能在typescript上使用firebase-admin,因为以下命令失败。
command: npm install @types/firebase-admin --save-dev
error: '@types/firebase-admin' is not in the npm registry.
根据此发行说明,firebase管理员似乎支持typescript。谁能告诉我们如何在云函数上使用typescript和firebase-a
我在angular 4项目中使用ng服务器运行,得到错误。
Cannot read property 'length' of undefined
但是我的项目中没有任何属性长度..
完整的错误
Your global Angular CLI version (1.2.1) is greater than your local
version (1.1.3). The local Angular CLI version is used.
To disable this warning use "ng set --global warnings.versionMi
一个月后,我回到了我的开发环境,运行了firebase serve --only functions。它给了我一些消息,我应该更新我的包。我只是按照说明,在开发机器上本地运行云函数被破坏了:(我从头开始重新启动所有的东西,并将所有依赖项更新到最新版本。不幸的是,我遇到了一些身份验证问题,我没有任何运气:(我得到了这个错误:
Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more informatio
我在Next.js应用程序中使用MobX。问题出在StoreProvider组件中。我按照上的说明操作。问题是
[mobx] The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)
这是RootStore
// import { firestore } from 'firebase';
import CandidatesStor
我想按如下方式从firebase-admin导入,但TypeScript不允许我这样做:
import * as firebase from 'firebase-admin';
import * as admin from 'firebase-admin';
我最终得到了以下错误:
ERROR: 17:1 no-duplicate-imports Multiple imports from 'firebase-admin' can be combined into one.
我尝试使用以下方法,但都不起作用:
import * as fir
我同时使用TypeScript和Firebase。
我的类有fireybase: FirebaseInterface;属性。
当我使用this.fireybase = new Firebase('URL/');初始化它时
我得到一个关于Firebase对象的编译时错误。
The name 'Firebase' does not exist in the current scope
interface FirebaseInterface {
set(s:string): any;
}
我已经尝试在库中添加一个Firebase接口,但它仍然不喜欢它。
在T
我是云功能的新手。
我有一个Android应用程序,它通过可调用的客户端调用云函数,而Cloud函数(node.js/typescript)调用Firestore来读取数据。
云功能代码:
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';
admin.initializeApp({credential : admin.credential.applicationDefault()});
exports.queryForData =
我正在编写的函数旨在操作客户端代码或云函数中的Firestore数据。
不幸的是,firebase (用于客户端代码)和firebase-admin (用于云函数)的TypeScript类型虽然几乎相同,但却不兼容。除了导入和别名所有类型之外,还有没有其他的解决方案?
目前,我收到的错误如下:
Type 'FirebaseFirestore.DocumentReference' is not assignable to type 'firebase.firestore.DocumentReference'
这是因为我在客户机代码库中使用firebase定义接口,
我目前有一个iOS应用程序的问题,我正在开发本机脚本和角质。最近,我将Xcode更新为9个版本,并在Xcode中为我的项目执行了一个清理工作,然后发生了问题,现在当我尝试执行tns运行iOS时,这里是输出:
tns run ios
Searching for devices...
Executing before-liveSync hook from /Users/onols/Desktop/ClubiesApp/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-prepare hook from /
我有两个类型记录/节点项目,都使用相同版本的节点。然而,当我在每个项目中使用import * as Crypto from 'crypto';时,它们指向两个不同版本的密码模块:
我对node和javascript / typescript非常陌生,并且很难理解其中的原因,希望有人能给我启发。我的问题是:为什么import * as Crypto from 'crypto';要解决两个不同版本的密码,即使项目设置使用相同的版本(我认为!)?什么决定使用内置模块的哪个版本?我如何解决这一问题,使两者使用相同的?
这是我的装置:
===Project 1
我用的是火基函数。我想用MM-DD-YYYY格式在30天后获得日期.我尝试导入数据表,但是ı得到了这样的错误:详细的堆栈跟踪:错误:找不到模块‘@角/公共’。
index.ts:
import * as functions from "firebase-functions";
import * as admin from "firebase-admin";
admin.initializeApp();
exports.scheduledFunction =
functions.pubsub.schedule("every 5 minutes"
我刚刚使用类星体CLI设置了一个新的Vue 3 项目。
我创建了一个新的src/firebase/config.ts文件来存储我的防火墙配置,如下所示:
// Import the functions you need from the SDKs you need
import { initializeApp } from 'firebase/app';
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#availa