Antoine
Antoine

Reputation: 91

Twitter cannot read meta tags on a SSR vue.js app

I'm trying to implement vue ssr on a website, and I'm stuck with one major problem... While my ssr seems to be working (when I go to my page without js activated, I receive the fully rendered html, with all the prefetched data), Twitter cannot read my meta tags...

My url is https://testsite2.slickteam.fr/job/developpeur-fullstack-js-java (site is not fully working, still in development, but ssr is working, and meta tags are available on this page). There are the meta "twitter:description", "twitter:title", "twitter:image" and others, but when I test with the Twitter card validator tool (https://cards-dev.twitter.com/validator) with this url, it says "INFO: Page fetched successfully WARN: No metatags found".

I have the same issue with Linkedin, but Facebook seems to be working just fine...

Does anyone have an idea about what could cause Twitter not being able to read my meta tags?

I'm using the vue-server-renderer package, with an express nodejs server behind an nginx.

Thanks

Upvotes: 3

Views: 647

Answers (1)

Antoine
Antoine

Reputation: 91

The http response do not include a Content-Type: text/html header.

In express js server, the solution is simple, simply add this line before sending the response:

response.set('Content-Type', 'text/html');

Upvotes: 4

Related Questions