sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7k stars 434 forks source link

Sapper Export does not render many nested closing tags #1702

Closed thebrianbug closed 3 years ago

thebrianbug commented 3 years ago

Sapper Export

Sapper export does not render markup after the %sapper.html% tag

To Reproduce

Create a new app with the template project.

npx degit "sveltejs/sapper-template#rollup" my-app
cd my-app
npm install
npm run export

Now, open up the __sapper__/export folder and view the index.html. Scroll to the end of the file, and notice there is no closing tag or anything else that comes after %sapper.html%. You can run a code formatter to see this easier.

Expected behavior

Sapper should render html after the %sapper.html% tag

Information about your Sapper Installation:

  System:
    OS: macOS 11.1
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 547.75 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.5.1 - ~/.nvm/versions/node/v15.5.1/bin/node
    npm: 7.3.0 - ~/.nvm/versions/node/v15.5.1/bin/npm
  Browsers:
    Brave Browser: 87.1.18.78
    Chrome: 88.0.4324.96
    Safari: 14.0.2
  npmPackages:
    rollup: ^2.3.4 => 2.37.1 
    sapper: ^0.28.0 => 0.28.10 
    svelte: ^3.17.3 => 3.31.2 

Severity

This is an annoyance that might be breaking my integration with netlify forms, but who really knows?

thebrianbug commented 3 years ago

I have to update this issue. The real issue seems to be like sapper is not closing TONS of tags. If you look at the output, lots and lots are missing closing tags. This is a bit bigger issue than I first posted, but hopefully not too bad to patch :).

benmccann commented 3 years ago

That's from https://github.com/sveltejs/sapper/blob/3c01d9300839358e01387c388527f3ec14b0e35b/src/api/utils/minify_html.ts

It shouldn't break anything and results in smaller download size. I believe SvelteKit does not have this if you'd simply like to wait until then

thebrianbug commented 3 years ago

Interesting. I think it may be breaking my integration with netlify forms post-processing of the HTML, but not sure. Thanks for letting me know. Is there any way to disable this for now?

thebrianbug commented 3 years ago

Here's the link if anyone is trying to follow this later https://community.netlify.com/t/netlify-forms-detected-but-not-being-properly-hydrated-in-ci-cd-and-not-submitting-svelte-sapper/30893/2

Conduitry commented 3 years ago

This is a duplicate of #1171 and #1455 and #1663. There's not currently a way to disable this - #348.