diff --git a/src/client.js b/src/client.js index 3c59e3d..f70eae2 100644 --- a/src/client.js +++ b/src/client.js @@ -5,8 +5,14 @@ import * as sapper from '@sapper/app'; // if we do not use this then we need to move sapper at end of // // -document.addEventListener('DOMContentLoaded', function() { +if (document.readyState !== 'loading') { sapper.start({ target: document.querySelector('#sapper') }); -}); +} else { + document.addEventListener('DOMContentLoaded', function() { + sapper.start({ + target: document.querySelector('#sapper') + }); + }); +}