Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty schema with SSR & renderHeadToString() #32

Closed
Fy- opened this issue Nov 16, 2022 · 4 comments
Closed

Empty schema with SSR & renderHeadToString() #32

Fy- opened this issue Nov 16, 2022 · 4 comments

Comments

@Fy-
Copy link

Fy- commented Nov 16, 2022

The schema is always empty in bodyTags when I call renderHeadToString() from @vueuse/head.

https://stackblitz.com/edit/vitejs-vite-krgcr3

bodyTags: '<script type="application/ld+json" data-id="schema-org-graph">{\n' +
  '  "@context": "https://schema.org",\n' +
  '  "@graph": []\n' +
  '}</script>',

It works on the client side:

{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@id": "https://google.com/#identity",
      "@type": "Organization",
      "name": "test",
      "url": "https://google.com"
    },
  //...
}`
@harlan-zw
Copy link
Collaborator

Hey @Fy-

Thanks for the issue and reproduction!

I can indeed replicate the issue, I have a solution in mind but it will require migrating the @vueuse/schema-org core to use the latest @vueuse/head. May be a couple of days before I have that ready

@markmartirosian
Copy link

Encountered this on 1.1.0-beta.6

@markmartirosian
Copy link

One more thing that may be related, changing UserConfig position does nothing.

@harlan-zw
Copy link
Collaborator

Thanks for your patience.

This seems to be fixed with v2, you can find a working version of your reproduction here: https://stackblitz.com/edit/vitejs-vite-hv2mlz?file=package.json

Let me know if you have any issues with the migration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants