Problem: Meta tags work in development but are missing in production.
Solution: Check the following:
pnpm build and check the generated HTMLexport default defineNuxtConfig({
seo: {
debug: true
}
})
lang Attribute Not AppliedProblem: You set htmlAttrs: { lang: 'ja' } in useHead() but the HTML element still shows lang="en".
Why: When automaticDefaults is enabled (default), the module automatically sets the lang attribute based on site config, not from useHead() calls.
Solution: Set the locale via site config instead:
export default defineNuxtConfig({
site: {
defaultLocale: 'ja'
}
})
See the I18n Guide for detailed information.
Problem: You're setting a custom canonical URL with useHead() but the module overrides it.
Why: The module sets canonical URLs with low priority by default when automaticDefaults is enabled.
Solution: Either disable automatic defaults or use higher priority:
// Option 1: Higher priority
useHead({
link: [{ rel: 'canonical', href: 'https://example.com/custom' }]
}, { tagPriority: 'high' })
// Option 2: Disable automatic defaults
export default defineNuxtConfig({
seo: {
automaticDefaults: false
}
})
When submitting an issue, it's important to provide as much information as possible.
The easiest way to do this is to create a minimal reproduction using the Stackblitz playgrounds: