unjs / unhead

Unhead is the any-framework document head manager built for performance and delightful developer experience.

Home Page:https://unhead.unjs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't seem to work properly under

nijinekoyo opened this issue · comments

Environment

"@unhead/vue": "^1.8.9"
"vite": "^4.5.0"
"vue": "^3.3.8"
"vue-router": "^4.2.5"

Reproduction

Neither useHead nor useSeoMeta works properly

Describe the bug

After I updated vite to 4.5.0 (I also updated many packages at the same time, I am not sure if this is the problem) neither useHead nor useSeoMeta can work properly. They can modify the head normally in dev mode. However, after building to production in SPA mode, the code no longer works properly, and no tags under the head are modified.

Additional context

No response

Logs

No errors were generated

Hi, I'll need a reproduction to help with you debug this. Unhead was working fine in Nuxt when it was using this version.

Sorry I'm using this package on a closed source project and I don't know how to reproduce the same issue on other projects

The following is the code that is causing the problem

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

useHead({
	meta: [
		{ name: 'status-code', content: '404' },
	],
})
</script>

Oh, I understand, it’s because I directly executed the createHead() registration in main.ts instead of mounting it under createApp().use()

It seemed to work fine in older versions, but I don't know when it stopped working.

I have the same issue, locally it works (in chrome extension - social share preview), but on production none of the meta tags are working properly (they are there though).
"vue": "^3.2.47",
"vite": "^4.1.4",
"@unhead/vue": "^1.8.9".

I'm using the package normally as showed documentation.

I have the same issue, locally it works (in chrome extension - social share preview), but on production none of the meta tags are working properly (they are there though). "vue": "^3.2.47", "vite": "^4.1.4", "@unhead/vue": "^1.8.9".

I'm using the package normally as showed documentation.

https://unhead.unjs.io/setup/vue/installation#demos
You can refer to this step to check whether the configuration is correct.

I also have the same issue as @Pajicc. I checked the link above, but it did not fix my problem. Meta tags are there but ignored.