Repository: sveltejs/sapper

Issue #1061: When building lists in loop, closing </li> tags are missing after build and export in html files.
Created: 2020-01-18T18:40:08Z
Describe the bug
When building list with looping over array, the closing  tags are missing on all list entries except the last one.
Logs
No failure or warning during build reported.
To Reproduce
<script>
    const dbMenu = [
        {
            name: 'One',
         },
        {
            name: 'Two'
        },
        {
            name: 'Three'
        }
    ]
</script>
<nav>
    <ul>
      {#each dbMenu as menu}
        <li>
            <a href=".">{menu.name}</a>
        </li>
      {/each}
    </ul>
</nav>

When i build and export the menu the html file misses closing tags </li> on some entries:
<nav>
     <ul>
         <li><a href=.>One</a>
         <li><a href=.>Two</a>
         <li><a href=.>Three</a></li>
     </ul>
 </nav>

I tried this on a fresh install of sapper with the same outcome. Somehow all except the last closing tag are missing.
Expected behavior
HTML should be valid.
Information about your Sapper Installation:
Ubuntu 18.04


Sapper version (Please check you can reproduce the issue with the latest release!)
"dependencies": {
"compression": "^1.7.1",
"polka": "next",
"sirv": "^0.4.0"
},
"devDependencies": {
"npm-run-all": "^4.1.5",
"sapper": "^0.27.0",
"svelte": "^3.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/runtime": "^7.0.0",
"@rollup/plugin-commonjs": "^11.0.0",
"@rollup/plugin-node-resolve": "^6.0.0",
"@rollup/plugin-replace": "^2.2.0",
"rollup": "^1.20.0",
"rollup-plugin-babel": "^4.0.2",
"rollup-plugin-svelte": "^5.0.1",
"rollup-plugin-terser": "^4.0.4"
}


If it is an exported (npm run export) or dynamic application.
exported html file (npm run build and then export).


Whether your application uses Webpack or Rollup
Same error in Webpack and Rollup.


Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Sapper entirely?
Makes usage of sapper impossible, because i can not build dynamic menus.

Duplicate issue #1455: HTML output is incorrect using sapper export
Created: 2020-08-29T15:31:46Z
Describe the bug
the index.html created using sapper export is missing </ body> and </ html> closing tags
Sapper v0.28.2
Here is an extract of my generated html file:
<body>
  <div id=sapper>
    <main class=svelte-18unutu>
    </main>
    <footer class=svelte-186b8as>
    </footer> 
  </div>
                        <script>__SAPPER__={baseUrl:"",preloaded:[void...
                        </script> <noscript> <img
                          src="https://www.facebook.com/tr?id=&ev=PageView&noscript=1" height=1
                          style=display:none width=1> </noscript>

--- END OF FILE

template.html:
<body>
	<!-- The application will be rendered inside this element,
	     because `src/client.js` references it -->
	<div id='sapper'>%sapper.html%</div>

	<!-- Sapper creates a <script> tag containing `src/client.js`
	     and anything else it needs to hydrate the app and
	     initialise the router -->
	%sapper.scripts%
	<noscript>
		<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=&ev=PageView&noscript=1" />
	</noscript>
</body>
</html>


To Reproduce
npx degit "sveltejs/sapper-template#rollup" my-app
cd my-app
npm i
npm run export
Expected behavior
file should end with expected closing tags

Closing comment (2020-08-29T18:10:08Z): Duplicate of #1061, #1161, and maybe others. Exported sites have their HTML minified, and this is by design.