Skip to content
This repository was archived by the owner on Oct 13, 2022. It is now read-only.

Commit 088c39f

Browse files
committed
Fix duplicate elements (sveltejs/sapper#1725)
1 parent 820f653 commit 088c39f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/client.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import * as sapper from '@sapper/app';
22

3-
sapper.start({
4-
target: document.querySelector('#sapper')
3+
window.addEventListener('load', () => {
4+
sapper.start({
5+
target: document.querySelector('#sapper')
6+
});
57
});

src/template.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
<link rel="stylesheet" href="global.css">
1111
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
1212
<link rel="icon" type="image/png" href="favicon.png">
13-
1413
<!-- Sapper creates a <script> tag containing `src/client.js`
15-
and anything else it needs to hydrate the app and
16-
initialise the router -->
14+
and anything else it needs to hydrate the app and
15+
initialise the router -->
1716
%sapper.scripts%
1817

1918
<!-- Sapper generates a <style> tag containing critical CSS
@@ -29,5 +28,7 @@
2928
<!-- The application will be rendered inside this element,
3029
because `src/client.js` references it -->
3130
<div id="sapper">%sapper.html%</div>
31+
32+
3233
</body>
3334
</html>

0 commit comments

Comments
 (0)