Skip to content

Commit 4b86575

Browse files
committed
fix(dev-server): fix initial load w/ errors
1 parent 69ef3b5 commit 4b86575

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/compiler/build/init-index-html.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ const APP_LOADING_HTML = `
186186
document.querySelector('.toast').classList.add('active');
187187
}, 100);
188188
189-
setInterval(function() {
189+
var tmrId = setInterval(function() {
190190
try {
191-
var url = window.location.pathname + '?' + Math.random();
191+
var url = window.location.pathname + '?r=' + Date.now();
192192
var xhr = new XMLHttpRequest();
193193
xhr.addEventListener('load', function() {
194194
try {
@@ -197,7 +197,10 @@ const APP_LOADING_HTML = `
197197
window.location.reload(true);
198198
}
199199
} else if (window.location.pathname !== '/') {
200-
url = '/' + Math.random();
200+
url = '/?r=' + Date.now();
201+
202+
} else if (this.status > 299) {
203+
clearInterval(tmrId);
201204
}
202205
203206
} catch (e) {

0 commit comments

Comments
 (0)