Vue & <noscript> issue

Viewed 6847

I have a vue app deployed and working as expected from functional perspective, however whenever I try to view source of rendered pages in a browser (any browser to be more precise) actual content is not visible and the body section starts with the following:

<noscript>
  <strong>We're sorry but this site doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>

When I inspect individual elements in can then see the source code.

The same results when tested with yarn dev and dist package from yarn build.

vue --version
2.9.6

Vue has been updated with the following:

yarn global upgrade @vue/cli

Needless to say that this is a major SEO issue.

Is this an app configuration or vue's environment's issue?

1 Answers

According to W3schools.com

The "noscript" tag defines an alternate content to be displayed to users that have disabled scripts in their browser or have a browser that doesn't support script.

The "noscript" element can be used in both "head" and "body" tag. When used inside "head", the "noscript" element could only contain "link", "style", and "meta" elements.

So we can easily conclude that, if any browser doesn't support or disabled the javascript then we can write some tags in the <noscript%gt; tag to inform the user that about it. Ex "Sorry your browser either doesn't support javascript or its disabled please enable it.

In the context of Vue, there is tag inside index.html which looks something as follows:

<noscript>
  <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>

It's just saying that, if you don't see our app working in your browser then maybe your browser doesn't support javascript. As the whole application is written with Vue and Vue is written in javascript.

So either your browser has disabled javascript which may be the underline issue, or your browser doesn't support javascript which is quite unbelievable as all modern browser does support it unless you have an old browser.

Related