You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started a new Nuxt3 project with npx nuxi init myproject
then installed i18n plugin immediately, when I tried to test by npm run dev
and open http://localhost:3000/
I got a 431 error
Here is my settings package.json
{
"name": "nuxt-app",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge@^8.0.0-beta.11-28025896.b896eaa",
"nuxt": "^3.4.1",
}
} nuxt.config.ts
export default defineNuxtConfig({
modules: [
'@nuxtjs/i18n',
],
i18n: {
vueI18n: './i18n.config.ts',
locales: ['tw', 'en'],
defaultLocale: 'tw',
},
}) i18n.config.ts
export default defineI18nConfig(nuxt => ({
legacy: false,
locale: 'tw',
messages: {
en: {
welcome: 'Welcome',
},
tw: {
welcome: '歡迎',
}
},
}))
beside installing i18n plugin, I didn't do anything more, this error seems not happen if I build the project and run in production mode, need some help and advice, thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I started a new Nuxt3 project with
npx nuxi init myproject
then installed i18n plugin immediately, when I tried to test by
npm run dev
and open http://localhost:3000/
I got a 431 error
Here is my settings
package.json
{
"name": "nuxt-app",
"private": true,
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"devDependencies": {
"@nuxtjs/i18n": "npm:@nuxtjs/i18n-edge@^8.0.0-beta.11-28025896.b896eaa",
"nuxt": "^3.4.1",
}
}
nuxt.config.ts
export default defineNuxtConfig({
modules: [
'@nuxtjs/i18n',
],
i18n: {
vueI18n: './i18n.config.ts',
locales: ['tw', 'en'],
defaultLocale: 'tw',
},
})
i18n.config.ts
export default defineI18nConfig(nuxt => ({
legacy: false,
locale: 'tw',
messages: {
en: {
welcome: 'Welcome',
},
tw: {
welcome: '歡迎',
}
},
}))
beside installing i18n plugin, I didn't do anything more, this error seems not happen if I build the project and run in production mode, need some help and advice, thanks.
Beta Was this translation helpful? Give feedback.
All reactions