【vue新人求救】vue一直打包出错
发布于 3 年前 作者 banyungong 1452 次浏览 来自 问答
粉丝福利 : 关注VUE中文社区公众号,回复视频领取粉丝福利

【vue新人求救】vue一直打包出错,提示:We’re sorry but vue2 doesn’t work properly without JavaScript enabled. Please enable it to continue.

刚刚接触vue,想用vue做一个小的展示数据的项目,但是安装完vue后

npm install -g @vue/cli

创建项目

vue create vuetest
cd vuetest
vue serve
// 到这里都正常,下面这个就报错了
yarn build

vue serve是正常的,可以打开http://localhost:8080,但是yarn build后是打不开dist/index.html的.
打包 yarn build,然后在dist下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">
    <link rel=icon href=/favicon.ico> <title>vue2</title>
    <link href=/css/app.e2713bb0.css rel=preload as=style>
    <link href=/js/app.120e4356.js rel=preload as=script>
    <link href=/js/chunk-vendors.e5bd9586.js rel=preload as=script>
    <link href=/css/app.e2713bb0.css rel=stylesheet>
</head>

<body><noscript><strong>We're sorry but vue2 doesn't work properly without JavaScript enabled. Please enable it to
            continue.</strong></noscript>
    <div id=app></div>
    <script src=/js/chunk-vendors.e5bd9586.js> </script> <script src=/js/app.120e4356.js> </script> </body> </html>

这个报错如何解决呢?
百度了1天都不知道怎么解决,不会打包vue,导致不敢开工。
有人也遇到这个报错嘛?
We're sorry but vue2 doesn't work properly without JavaScript enabled. Please enable it to continue.请问怎么解决呢?

回到顶部