Skip to content

Commit

Permalink
fix: warn if seo features are used without baseUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede committed Sep 30, 2024
1 parent f1dafc2 commit 5089f83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/runtime/composables/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */
import { useRequestHeaders, useCookie as useNuxtCookie } from '#imports'
import { ref, computed, watch, onUnmounted } from 'vue'
import { ref, computed, watch, onUnmounted, unref } from 'vue'
import { parseAcceptLanguage, wrapComposable, runtimeDetectBrowserLanguage } from '../internal'
import { DEFAULT_DYNAMIC_PARAMS_KEY, localeCodes, normalizedLocales } from '#build/i18n.options.mjs'
import { getActiveHead } from 'unhead'
Expand Down Expand Up @@ -80,6 +80,10 @@ export function useSetI18nParams(seo?: SeoAttributesOptions): SetI18nParamsFunct
const currentLocale = getNormalizedLocales(locales).find(l => l.code === locale) || { code: locale }
const currentLocaleLanguage = currentLocale.language

if (!unref(i18n.baseUrl)) {
console.warn('I18n `baseUrl` is required to generate valid SEO tag links.')
}

const setMeta = () => {
const metaObject: HeadParam = {
link: [],
Expand Down

0 comments on commit 5089f83

Please sign in to comment.