Skip to content

Commit

Permalink
fix: ignore polyfill error in Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 17, 2023
1 parent 9da4827 commit 39f4ab1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/output/srcdoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,16 @@
window.addEventListener('message', handle_message, false);

window.onerror = function (msg, url, lineNo, columnNo, error) {
// ignore errors from import map polyfill - these are necessary for
// it to detect browser support
if (msg.includes('module specifier “vue”')) {
// firefox only error, ignore
return false
}
if (msg.includes('Module specifier, \'vue')) {
// Safari only
return false
}
try {
parent.postMessage({ action: 'error', value: error }, '*');
} catch (e) {
Expand Down

0 comments on commit 39f4ab1

Please sign in to comment.