1

If you take a look at this page http://manvanstage.com.s3-website.eu-west-2.amazonaws.com/ and right click on it and choose "View page source" you will find for example the text "100s Man With Van Providers" inside <script type="text/javascript"> instead of inside inside an HTML tag.

These tags are sent by the back-end API to the front-end (Nuxt.js/vue.js)

I tried to use Vue.js lifecycle created and mounted.

What I'm doing wrong?

I know this is bad for SEO.

Update:

  • Part of this web page I used no-ssr. Do you think this maybe the cause of the issue?
  • I used npm run build and deploy the application on Node.js severer.
2
  • 1
    do you have npm (or yarn) running on the server or did you upload the nuxt generated pages (with npm run nuxt generate (or yarn nuxt generate) ) Commented Jan 23, 2020 at 18:31
  • @ToniMichelCaubet I use Node.js server npm run build Commented Jan 23, 2020 at 21:40

1 Answer 1

1

maybe you should check mode property is correctly set 'universal' in nuxt.config.js

https://nuxtjs.org/api/configuration-mode/

Update:

I think it is because you fetch data in created or mounted so they are still not server-side rednder

if you want show something content in source to imporve SEO then fetch your data in asyncData()

example:

before

created(){
  this.getSomethingFromAPI()
}

after

asyncData(){
  this.getSomethingFromAPI()
}
Sign up to request clarification or add additional context in comments.

1 Comment

The mode is correct, maybe it's no-ssr tag I used.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.