【发布时间】:2021-05-11 11:02:31
【问题描述】:
我正在学习 firebase 云功能,在我的 index.ts 文件夹中,我在 import
下突出显示了错误消息我不知道这意味着什么以及如何解决它最糟糕的是,相同的代码在 youtube 上的 firebase 教程视频中工作
这段代码有什么问题?
import * as functions from "firebase-functions";
// Start writing Firebase Functions
// https://firebase.google.com/docs/functions/typescript
export const helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", { structuredData: true });
response.send("Hello from Firebase!");
});
这是我的 tsconfig
{
"compilerOptions": {
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": ["src"]
}
【问题讨论】:
-
你能发布你的 tsconfig 文件吗?
-
我加了,我觉得和你的一样
-
您的
index.ts在src目录中吗? -
是的,它在
src目录中
标签: reactjs typescript firebase visual-studio-code