qwik
qwik copied to clipboard
All qwik scripts are inserted after `</body>`, so it's invalid HTML
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
@manucorporat just discovered this only happens in dev.
build is fine
interesting… i will look into this before official beta, also annoys me a bit to emit stuff outside body :)
@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
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.