Closed Yofo-me closed 1 year ago
一些错误
GET https://analytics.ytt.yt/umami.js net::ERR_ABORTED 502
Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
A bad HTTP response code (404) was received when fetching the script.
Error during service worker registration: TypeError: Failed to register a ServiceWorker for scope ('https://域名/') with script ('https://域名/sub-web.js'): A bad HTTP response code (404) was received when fetching the script.
GET https://域名/manifest.json 404 (Not Found)
Manifest: Line: 1, column: 1, Syntax error.
在vue.config.js
添加如下配置:
module.exports = {
publicPath: "./",
}
重新编译即可。 不要使用nginx的路由,太麻烦。
sub-web在yarn build后将生成的dist目录下的所有文件放在网站的
sub
目录下,直接访问网站域名/sub
时css js
会加载失败,用chrome调试功能发现:本应该是网站域名/sub/css/*.css
实际访问的是网站域名/css/*.css
,;本该是网站域名/sub/js/*.js
实际上是网站域名/js/*.js
。手动在网站的conf中加了这些配置(如图所示),但还是不行请问如果要把sub-web部署在网站的子目录下,应该怎么弄呢?