Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Missing </body> and </html> in SSR markup #1663

Closed
Jayphen opened this issue Dec 8, 2020 · 4 comments
Closed

Missing </body> and </html> in SSR markup #1663

Jayphen opened this issue Dec 8, 2020 · 4 comments

Comments

@Jayphen
Copy link
Contributor

Jayphen commented Dec 8, 2020

I've noticed this in two of our production sites, and also verified the same on https://sapper.svelte.dev/

Check the server rendered markup and observe that the closing body and html tags are missing.

Most browsers will be fine with this, but I noticed it because it causes GTM to issue warnings about their tags not being found in the body.

@benmccann
Copy link
Member

It's probably coming from https://github.com/sveltejs/sapper/blob/master/src/api/utils/minify_html.ts

This file doesn't exist in SvelteKit, so this issue should solve itself when migrating

@Jayphen
Copy link
Contributor Author

Jayphen commented Dec 8, 2020

Can we re-open this as it is a bug that should probably be tracked and fixed (possibly by me). Or are patch releases no longer happening?

@benmccann
Copy link
Member

I think the tricky thing about this one is it's not clearly a bug. The issue here seems to be that it can't be configured. But Sapper doesn't have any method of handling configuration (#1216). And I don't think we'd be likely to introduce configuration handling in Sapper since that'd be such a large change. SvelteKit already has configuration handling, so hopefully this whole class of issues will go away.

If it were a smaller issue to fix, I think it'd be fine to accept a patch release. This one kind of seems like it might be a can of worms though

@Jayphen
Copy link
Contributor Author

Jayphen commented Dec 8, 2020

Ah, gotcha. Looks like it's expected behaviour with the removeOptionalTags option being passed to html minifier. Dang…

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants