2

I have made a angular application and I want to test it in audit but in PWA under audit, i got error in PWA optimized section like

Does not provide fallback content when JavaScript is not available

I have even written <noscript>Please enable javascript</noscript> in index.html file. I have not got this error when i ran audit in localhost by starting http-server but the same thing i am checking on server then it gives red mark in PWA optimized section? How to solve this ?

This is the error: enter image description here

Akber Iqbal
  • 12,257
  • 11
  • 34
  • 52
JAYDIP HIRAPARA
  • 257
  • 3
  • 14

1 Answers1

1

Usually, Adding the <noscript> block on your page would take care of this... I had gone around this myself on my website

Referring to Google's site (which i visited today after your question, we see the description:

Given these considerations, this Lighthouse audit performs a simple check to ensure that your page isn't blank when JavaScript is disabled. How strictly your app adheres to progressive enhancement is a topic of debate, but there's widespread agreement that all pages should display at least some information when JavaScript is disabled, even if the content is just an alert to the user that JavaScript is required to use the page.

For pages that absolutely must rely on JavaScript, one approach is to use a element to alert the user that JavaScript is required for the page. This is better than a blank page, because the blank page leaves users uncertain about whether there's a problem with the page, their browsers, or their computers.

I suspect that when you disable javascript via chrome, you might end up with just the text "Please enable javascript"; Try also placing

  • an image, a backup navigation (which runs in case of no JS only)
  • a backup footer (which runs in case of no JS only)
Akber Iqbal
  • 12,257
  • 11
  • 34
  • 52