question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[question] ssg for social sharing not updated, and content is empty

See original GitHub issue

hi,

my page/index.vue works with useHead on browser when script is executed, but when called via curl, it showing the original title from Vitess not updated with my “Test Home”

<script lang="ts" setup>
import { useHead } from '@vueuse/head'

useHead({
  title: 'Test Home',
  meta: [
    {
      name: 'description',
      content: 'This is our home',
    },
  ],
})

result of curl

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><link rel="icon" href="/favicon.ico"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Vitesse</title><script type="module" async="" crossorigin="" src="/assets/app.dc643c37.js"></script><link rel="modulepreload" href="/assets/vendor.b37b8568.js"><link rel="stylesheet" href="/assets/vendor.1f66886f.css"><link rel="stylesheet" href="/assets/app.015d4955.css"><link rel="manifest" href="/manifest.webmanifest"><meta name="description" content="Opinionated Vite Starter Template"><meta name="head:count" content="1"></head><body><div id="app" data-server-rendered="true"></div><script>window.__INITIAL_STATE__='{"pinia":{"alert":{"loading":false,"success":"","error":"","link":"","linkLabel":""}}}'</script></body></html>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12

github_iconTop GitHub Comments

2reactions
bfourgeaudcommented, Feb 27, 2022

@u007 I haven’t found any simple solution to this problem so I switch my project to NextJS. But The solution lies somewhere in vite-ssg confurguration and the “includesRoutes” options.

As a matter of fact, you have to tell vite-ssg what real routes are behind the dynamic route, and make an API call at build time to tell him what pages to generate. It ius the only way to server-side-generate the dynamic pages. On NextJS this handling is automatic and is widly known (GetStaticPaths), but on vite-ssg I couldn’t find no example of it, and there is nothing in the documentation…

Here is another github issue where they are talking about that subject (related to vite-plugin-pages and dynamic route generation with vite-ssg) : https://github.com/hannoeru/vite-plugin-pages/issues/40

Hoping for you o find your answer, I’ve searched for weeks without solutions.

2reactions
u007commented, Feb 26, 2022

anyone have a solutions? its been here for over a month now, urgently need this fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Social Sharing not loading when I click the button to share
I tried many methods, but when I install it on phone and click on the buttons bellow with example methods, nothing rappens. home.html:...
Read more >
when to use SPA, SSR, and SSG - kirill ibrahim - Medium
Being empty <body> means there will be not content to crawl the data for a search engine, so SEO is the biggest weak...
Read more >
Yes, here are 4 ways to handle SEO with Vue (even without ...
But a better question is “how to handle SEO in a SPA (Single Page Application)”, and my answer is: SSR is not the...
Read more >
Topic: Renew Stack Blog Social Sharing not working correctly ...
For some reason, the social sharing icon links from my blog seem to pull another posts content. I haven't modified any templates or...
Read more >
How to Create a Contact Form - Resource Center
Add — Start a new form and begin adding questions. add_a_form.jpg ... Click and drag it into an empty content clock. drag.jpg. 3....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found