Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
错误:在Firebase主机中部署VueJS应用程序_Firebase_Vue.js_Webpack_Firebase Hosting - Fatal编程技术网

错误:在Firebase主机中部署VueJS应用程序

错误:在Firebase主机中部署VueJS应用程序,firebase,vue.js,webpack,firebase-hosting,Firebase,Vue.js,Webpack,Firebase Hosting,我有一个vue应用程序,我安装了firebase工具并将应用程序上载到firebase主机,第一次全部完成后,我进行了npm运行构建和firebase部署,但当我意识到任何更改,然后执行npm运行服务或构建或firebase部署时,我出现了下一个错误: Template execution failed: ReferenceError: features is not defined ReferenceError: features is not defined - index.ht

我有一个vue应用程序,我安装了firebase工具并将应用程序上载到firebase主机,第一次全部完成后,我进行了
npm运行构建
firebase部署
,但当我意识到任何更改,然后执行
npm运行服务
构建
firebase部署
时,我出现了下一个错误:

Template execution failed: ReferenceError: features is not defined

  ReferenceError: features is not defined

  - index.html:4 eval
    [.]/[html-webpack-plugin]/lib/loader.js!./public/index.html:4:10

  - index.html:7 module.exports
    [.]/[html-webpack-plugin]/lib/loader.js!./public/index.html:7:3

  - index.js:284 Promise.resolve.then
    [real]/[html-webpack-plugin]/index.js:284:18


  - next_tick.js:188 process._tickCallback
    internal/process/next_tick.js:188:7

有什么想法吗?我不知道为什么这个问题会成功。谢谢。

当您安装firebase工具时,它会为您生成一个公用文件夹。在该公用文件夹中,有一个index.html文件(该文件是导致错误的原因)。只需删除index.html文件中的所有内容,然后替换为您自己的内容。

在firebase.json文件中,将主机更改为
“public”:“public”
“public”:“dist”
安装firebase时,它更改了文件public/index.html,原始版本如下所示:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="icon" href="<%= BASE_URL %>favicon.ico">
    <title>hello-world-vuetify</title>
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
  </head>
  <body>
    <noscript>
      <strong>We're sorry but hello-world-vuetify doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>

你好,世界杯
很抱歉,如果没有启用JavaScript,hello world vuetify无法正常工作。请使其继续。
替换内容,它对我有用