qwik icon indicating copy to clipboard operation
qwik copied to clipboard

All qwik scripts are inserted after `</body>`, so it's invalid HTML

Open felixsanz opened this issue 3 years ago • 2 comments
trafficstars

Qwik Version

0.0.41

Operating System (or Browser)

Node

Node Version (if applicable)

No response

Which component is affected?

Qwik City

Expected Behaviour

City version: 0.0.32

This stuff:

<script type="qwik/json">...</script>
<link href="[/build/q-0c40d054.js](https://qwik.builder.io/build/q-0c40d054.js)" rel="prefetch" as="script">
<script id="qwikloader">...</script>

Is inserted between </body> and </html>, which renders invalid HTML. It should be added INSIDE the body, not after.

Some discord triage:

manucorporat — Today at 8:21 PM
something to solve, it's like this because of the new streaming render, much easier to just add before the end of the container

manucorporat — Today at 8:25 PM
we need to teach the SSR render to inject the beforeClose, inside the body, right now we already do similar tricks with head for styles

Actual Behaviour

.

Additional Information

No response

felixsanz avatar Aug 10 '22 19:08 felixsanz

@manucorporat just discovered this only happens in dev.

build is fine

felixsanz avatar Aug 11 '22 15:08 felixsanz

interesting… i will look into this before official beta, also annoys me a bit to emit stuff outside body :)

manucorporat avatar Aug 11 '22 22:08 manucorporat

@felixsanz just checked it on a cloudflare hosted test app and it seems still to be the case. so even builds are invalid atm. note: https://validator.w3.org/unicorn/check?ucn_uri=qwik.builder.io&ucn_lang=en&ucn_task=conformance# cc: @manucorporat

zanettin avatar Nov 24 '22 22:11 zanettin

After some discussion we decided to close this issue and leave it as is since browsers are still executing the scripts correctly, despite being after the body.

adamdbradley avatar May 12 '23 19:05 adamdbradley