We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0161cba + 3037577 commit fe601cfCopy full SHA for fe601cf
src/client.js
@@ -5,8 +5,14 @@ import * as sapper from '@sapper/app';
5
// if we do not use this then we need to move sapper at end of <body>
6
// <https://caniuse.com/domcontentloaded>
7
//
8
-document.addEventListener('DOMContentLoaded', function() {
+if (document.readyState !== 'loading') {
9
sapper.start({
10
target: document.querySelector('#sapper')
11
});
12
-});
+} else {
13
+ document.addEventListener('DOMContentLoaded', function() {
14
+ sapper.start({
15
+ target: document.querySelector('#sapper')
16
+ });
17
18
+}
0 commit comments