Open POPOEVER opened 5 years ago
Have you tried removing <div id='sapper'>%sapper.html%</div>
from template.html? This removed the duplicate component from my pages. If you have client.js "imprint" the app onto body (e.g. target: document.querySelector('body')
) you shouldn't need the #sapper div container.
Same bug here, I tryed @jspinella suggestion but the stacked render continues.
I'm having this issue as well.
Describe the bug When using conditional render in top-level route
_layout.svelte
,_error.svelte
template stacks itself up twice.Code
Result
Even in a fresh Sapper clone, when I do nothing but turn
<Nav {segment} />
in_layout.svelte
intoThen when I navigate away from 404 page into a top-level route page, this is what happens
Expected behavior What I'm trying to do is to hide navbar component on the homepage, I tried to remove navbar component from top-level _layout and import the navbar to nested route _layout, but I don't know why
segment
doesn't work in nested route _layout, it's always logged asundefined
, that's why I use conditional render syntax in top-level _layout as the solution so far.Information about your Sapper Installation:
Your browser and the version: Chrome 76.0.3809.100/Edge Canary 78.0.254.0/Safari 12.1.2 (14607.3.9)
Your operating system: OS X 10.14.6 (18G87)
Your hosting environment: localhost dev environment served via
sirv 0.4.2
Sapper version: 0.27.8
Svelte version: 3.9.1
If it is an exported (npm run export) or dynamic application. Issue reproduced under both
dev
andexport
Whether your application uses Webpack or Rollup Rollup
Severity It makes my page unusable, I'm not sure how severe it is, but to me, it's like 10 out of 10, because I found no routing solution to fix it.