intlify / intlify/nuxt3

intlify: { ...; }; }' is not assignable to parameter of type 'NuxtConfig'.

Open
#36 6 comments 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
204
Forks
18
PR merge metrics
No merged PRs in 30d

Description

When installing as described by the documentation, the follwing typescript error occurs in the nuxt.config.ts file:
intlify: { ...; }; }' is not assignable to parameter of type 'NuxtConfig'.
Object literal may only specify known properties, and 'intlify' does not exist in type 'NuxtConfig'.ts(2345)

Intlify is working despite the error, but it is important to have the types supported. How can this be achieved?

nuxt.config.ts:
```
import { defineNuxtConfig } from "nuxt3";

export default defineNuxtConfig({
...
buildModules: [
"@intlify/nuxt3"
],
intlify: {
vueI18n: {
// You can setting same `createI18n` options here !
baseUrl: "https://my.com",
defaultLocale: "en",
localeDir: "locales",
locale: [
{ code: 'de', iso: 'de-DE', file: 'de-DE.json', dir: 'ltr' },
{ code: 'en', iso: 'en-US', file: 'en-US.json', dir: 'ltr' }
],
strategy: "prefix_and_default",
lazy: true,
detectBrowserLanguage: {
alwaysRedirect: false,
fallbackLocale: 'en',
redirectOn: 'root',
useCookie: true,
cookieCrossOrigin: false,
cookieDomain: null,
cookieKey: 'i18n_redirected',
cookieSecure: false
},
vuex: false
},
}
});

export interface IntlifyModuleOptions {
/**
* Options specified for `createI18n` in vue-i18n.
*
* If you want to specify not only objects but also functions such as messages functions and modifiers for the option, specify the path where the option is defined.
* The path should be relative to the Nuxt project.
*/
vueI18n?: I18nOptions | string
/**
* Define the directory where your locale messages files will be placed.
*
* If you don't specify this option, default value is `locales`
*/
localeDir?: string
}
```

package.json:
```
{
"private": true,
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"start": "node .output/server/index.mjs"
},
"devDependencies": {
"@headlessui/vue": "latest",
"@heroicons/vue": "latest",
"@tailwindcss/forms": "latest",
"@types/tailwindcss": "latest",
"autoprefixer": "^10.4.0",
"nuxt3": "latest",
"tailwindcss": "^3.0.7",
"@intlify/nuxt3": "^0.1.10"
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.