with Nuxt 3.4.1 get 431 error #2009
Unanswered
jesse-chan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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