-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client side script inside layout file makes html lang attribute disappear #660
Comments
Can repro. |
mark |
Seems like the entire |
I think it makes sense for Astro to support it, since the default for components is top-level scripts and styles associated with the component. this is a weird edgecase, but isn't it the same sort of dx? |
* fix(#660): allow script before HTML * chore: add changeset * fix: remove style from logic (already works) * chore: add doctype Co-authored-by: Nate Moore <[email protected]>
I've recently stumbled across this bug on my website as well and here's the source code particularly responsible for generating the base template. Is there any way I can debug and perhaps identify what the root cause of the issue is? |
Looks like this is caused not just by the |
@skilar that fixed the issue! Thanks for it. I'm curious, what was wrong with the code there? |
I'm not sure what the issue is, @Jarmos-san, seems like there's still a bug in Astro. |
Having same issue, astro 4.6.3 |
For those who have this issue, according to docs you should include scripts and styles inside of html tags: https://docs.astro.build/en/basics/layouts/ |
What version of
astro
are you using?1.6.11
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
yarn
What operating system are you using?
Mac
Describe the Bug
It seems using a
<script>
inside the layout which declares thehtml
element will make thelang
attribute disappear.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-xuenvq?file=src/layouts/Layout.astro
Participation
The text was updated successfully, but these errors were encountered: