一、报错问题收集
1、页面停留半小时左右不动卡死报错问题
Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: http://10.233.54.161/assets/index.f8110bbc.js
Promise.then (async)
E @ main.c19f562f.js:39
f @ main.c19f562f.js:39
z.onClick.t..t. @ main.c19f562f.js:39
Rd @ main.c19f562f.js:1
oA @ main.c19f562f.js:1
n @ main.c19f562f.js:1
main.c19f562f.js:48 TypeError: Failed to fetch dynamically imported module: http://10.233.54.161/assets/index.f8110bbc.js
// 上线代码后本地及测试报错(页面卡死,需要手动刷新才能解决)
window.addEventListener('error', function (event) {
if(event.message.includes('Failed to fetch dynamically imported module')){
window.location.reload()
}
})
二、不常用小技术点记录
1、接口报错提示文案换行
import { ElMessage } from 'element-plus';
ElMessage({
dangerouslyUseHTMLString: true, // 能识别HTML标签
message: res.data.filter((item:any) => item.length).join('<br/>'),
type: 'error',
duration: 5000,
})
2、