@lark-apaas/fullstack-vite-preset 1.0.32-alpha.7 → 1.0.32-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -66,7 +66,7 @@ try {
|
|
|
66
66
|
}),
|
|
67
67
|
}, '*');
|
|
68
68
|
window.parent.postMessage({ type: 'RenderError', data: 'compileError' }, '*');
|
|
69
|
-
} catch (e) {}
|
|
69
|
+
} catch (e) { /* postMessage 失败可安全忽略,如 target origin 不匹配 */ }
|
|
70
70
|
try {
|
|
71
71
|
window.__COMPILE_ERROR__ = error;
|
|
72
72
|
const s = document.createElement('script');
|
package/package.json
CHANGED
|
@@ -519,7 +519,8 @@ if (!window.__VITE_ERROR_OVERLAY_INITIALIZED__) {
|
|
|
519
519
|
// 过滤已知常见噪声 (favicon / apple-touch-icon / manifest 等浏览器自动请求),
|
|
520
520
|
// 避免用户"页面日志"面板被这类无害 404 淹没
|
|
521
521
|
if (/\/favicon\.(ico|png|svg)|\/apple-touch-icon|\/manifest\.json|\/robots\.txt/.test(url)) return;
|
|
522
|
-
|
|
522
|
+
// 资源 404 只上报到页面日志,不 render overlay(避免整页遮盖用户预览)
|
|
523
|
+
logError(['Resource load failed', tag.toLowerCase(), url], 'runtimeError');
|
|
523
524
|
}
|
|
524
525
|
}
|
|
525
526
|
}, true);
|
|
@@ -582,9 +583,10 @@ if (!window.__VITE_ERROR_OVERLAY_INITIALIZED__) {
|
|
|
582
583
|
const msg = (err.message || '') + (err.frame ? '\n\n' + err.frame : '');
|
|
583
584
|
showCompileError(msg);
|
|
584
585
|
} catch (e) {
|
|
585
|
-
//
|
|
586
|
+
// showCompileError 失败可安全忽略 —— overlay 渲染降级不阻塞后续 setup;
|
|
587
|
+
// 且 SELECTED_LOG postMessage 已在服务端内联 script 里发过,页面日志不会丢
|
|
586
588
|
}
|
|
587
|
-
try { delete window.__COMPILE_ERROR__; } catch (e) {}
|
|
589
|
+
try { delete window.__COMPILE_ERROR__; } catch (e) { /* strict-mode / non-configurable delete 失败可安全忽略,不影响主流程 */ }
|
|
588
590
|
}
|
|
589
591
|
|
|
590
592
|
setupViteHMRListener();
|