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

Cannot find name 'defineI18nLocaleDetector' #3297

Open
shopline opened this issue Jan 9, 2025 · 0 comments
Open

Cannot find name 'defineI18nLocaleDetector' #3297

shopline opened this issue Jan 9, 2025 · 0 comments

Comments

@shopline
Copy link

shopline commented Jan 9, 2025

Environment

I am following this guide step by step:
https://i18n.nuxtjs.org/docs/guide/server-side-translations

i18n/localeDetector.ts
export default defineI18nLocaleDetector((event: any, config: any) => {
  return "se";

  // If the locale cannot be resolved up to this point, it is resolved with the value `defaultLocale` of the locale config passed to the function
  return config.defaultLocale;
});

Error in my IDE:

Cannot find name 'defineI18nLocaleDetector'. Did you mean 'defineI18nLocale'?ts(2552)
imports.d.ts(20, 9): 'defineI18nLocale' is declared here.

Config is set:

export default defineNuxtConfig({
  i18n: {
    experimental: {
      localeDetector: 'localeDetector.ts'
    }
  }
})

I click details link: https://i18n.nuxtjs.org/docs/api#definei18nlocaledetector

And it is empty.

Reproduction

Here: https://i18n.nuxtjs.org/docs/guide/server-side-translations

Describe the bug

Cannot find name 'defineI18nLocaleDetector'. Did you mean 'defineI18nLocale'?ts(2552)
imports.d.ts(20, 9): 'defineI18nLocale' is declared here.

Additional context

No response

Logs

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

No branches or pull requests

1 participant