Troubleshooting Nuxt SEO Utils
Common Issues
Meta Tags Missing in Production
Problem: Meta tags work in development but are missing in production.
Solution: Check the following:
- Ensure you're using SSR (not SPA mode)
- Run
pnpm buildand check the generated HTML - Enable debug mode to see what's being set:
export default defineNuxtConfig({
seo: {
debug: true
}
})
lang Attribute Not Applied
Problem: 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.
Canonical URL Not Using My Custom Logic
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
}
})
Submitting an Issue
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: