-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Fix Lighthouse Audit warning: missing noscript block #954
Conversation
Adds a noscript block to the head of the template, to inform visitors that javascript is required. Fixes the warning in Lighthouse Audit: https://web.dev/without-javascript/?utm_source=lighthouse&utm_medium=devtools Placed in body to support html4 as well as html5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preact CLI prerender it's pages, therefore this warning should not be present in the out of the box setup. Are you using --no-prerender
flag?
No, I am not using If the prerendering process empties the body as part of the rendering, it might be necessary to move the |
Body content from the template is preserved during prerendering. I'm on the fence about this one. It seems like lighthouse is recommending an actively harmful technique here, though checking the audit description I'm not sure it is?
One potentially interesting thing to note here is that Preact CLI can be used to produce apps that are entirely reliant on JS, or apps that don't need it at all to function. I think one of the key indicators of this would be whether or not Just so I'm following along, how were you getting lighthouse to produce this warning? A freshly installed Preact CLI app? |
No, good thing to point out. It is not a freshly installed Preact CLI app, but a Preact CLI app I've been working on for some time. |
Just a thought - any chance you noticed this audit failing during development mode? ( During development mode prerendering is disabled, since it breaks caching. |
No, it was built with yarn build / preact build. |
Just deployed and tested using Preact X. |
@prateekbh I'd assume most users of preact-cli don't make completely static sites with it, so not having javascript would probably break stuff Should probably be configurable or smth |
Adds a noscript block to the body of the template, to inform visitors that javascript is required.
Fixes the warning in Lighthouse Audit:
https://web.dev/without-javascript/?utm_source=lighthouse&utm_medium=devtools
Placed in body to support html4 as well as html5