[英]getting a parse error and cannot find eslint file
I've realized that you can't send messages directly from the client with the FCM v1 API so now I'm using node.js and I wan't to deploy this cloud function, but I am getting a parse error like so:我已经意识到您不能使用 FCM v1 API 直接从客户端发送消息,所以现在我正在使用 node.js 我不想部署这个云 ZC1C425268E68385D1AB5074C17A94
This is my function:这是我的 function:
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const { event } = require("firebase-functions/lib/providers/analytics");
admin.initializeApp(functions.config().firebase);
exports.sendNotificationsToTopic =
functions.firestore.document("school_users/{uid}/events/{docID}").onWrite(async (event) => {
let docID = event.after.id;
let schoolID = event.after.get("school_id")
let title = "New Event!!"
let notificationBody = "A new event has been added to the dashboard!!"
var message = {
notification: {
title: title,
body: notificationBody,
},
topic: schoolID,
};
let response = await admin.messaging().sendToTopic(message);
console.log(response);
});
I did some research and found people were getting similar errors with their projects, and answers were saying to update the version of eslint so it picks up on the shorthand syntax, I can't figure out where to find the eslint file to update the version.我做了一些研究,发现人们在他们的项目中遇到了类似的错误,答案是要更新 eslint 的版本,所以它会采用速记语法,我不知道在哪里可以找到 eslint 文件来更新版本. Does anybody know where I can find this file?有人知道我在哪里可以找到这个文件吗?
All I needed to do was show my hidden files in my functions
directory.我需要做的就是在我的functions
目录中显示我的隐藏文件。 Once I seen the .eslintrc.js
file, I simply removed a part of a value from the "eslint" key, and the function deployed perfectly fine.一旦我看到.eslintrc.js
文件,我只是从“eslint”键中删除了一部分值,并且 function 部署得非常好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.