VUE部署报We're sorry but duty doesn't work properly without JavaScript enabled.

本地运行正常,部署到服务上,访问页面一片空白,开发者模式查看,发现报

<noscript>
"<strong>We're sorry but duty doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>"
</noscript>

经百度,最简单的处理方法是在vue.config.js里配置如下

publicPath: './',

vue.config.js的完整配置如下

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  publicPath: './',
  transpileDependencies: true
})

配置完成后,页面访问正常!!!

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容