【问题标题】:Error running "firebase deploy --only functions"运行“firebase deploy --only 功能”时出错
【发布时间】:2023-03-27 06:20:01
【问题描述】:

当我尝试运行“firebase deploy --only 函数”时,我的代码出现错误。 这是我的代码:

app.post('/payments/create', async (request, response) => {
    const total = parseInt(request.query.total);
    console.log('Payment request receive! - ', total);
    const paymentIntent = await stripe.paymentIntents.create({
        amount: total,
        currency: "usd",
    });
    response.status(201).send({
        clientSecret: paymentIntent.client_secret,
    });
});

这是我的错误: 19:56 error Parsing error: Unexpected token =>

【问题讨论】:

    标签: node.js reactjs firebase deployment


    【解决方案1】:

    我必须在 .eslintrc.js 中添加 ecmaVersion

    parserOptions: {
        // Required for certain syntax usages
        ecmaVersion: 2017,
      },
    

    【讨论】:

      猜你喜欢
      • 2021-05-12
      • 2022-06-16
      • 2020-12-14
      • 2019-03-30
      • 1970-01-01
      • 2019-10-30
      • 1970-01-01
      相关资源
      最近更新 更多