Firebase 502从封装Express应用程序的函数请求静态*.js文件时出错

Firebase 502从封装Express应用程序的函数请求静态*.js文件时出错,firebase,express,google-cloud-functions,Firebase,Express,Google Cloud Functions,我们通过Firebase函数提供静态文件 const functions = require('firebase-functions'); const express = require('express'); const app = express(); app.use(express.static('dist')) exports.staticFiles = functions.https.onRequest(app); 我们的dist/目录包含两个文件: dist/ index.

我们通过Firebase函数提供静态文件

const functions = require('firebase-functions');
const express = require('express');

const app = express();
app.use(express.static('dist'))

exports.staticFiles = functions.https.onRequest(app);
我们的
dist/
目录包含两个文件:

dist/
  index.html
  app.js
请求
我们的project.cloudfunctions.net/staticFiles/index.html
将提供预期的html文件。请求
我们的project.cloudfunctions.net/staticFiles/app.js
返回502错误

我们如何从Firebase函数提供简单的*.js文件

其他细节
  • 我们正在制定燃烧计划
  • 日志显示:函数执行耗时922毫秒,完成状态为“response error”

    • 有一个文件大小限制:

      最大未压缩HTTP响应大小:10MB