admin管理员组文章数量:1399217
In my Nuxt.js application, I installed the nuxt-i18n according to how the documentation suggests:
{
modules: [
['nuxt-i18n', {
// Options
}]
]
}
But when I run npm run dev, I get this error message:
DONE Compiled successfully in -4519ms 12:53:52
OPEN http://localhost:3000
nuxt:render Rendering url / +0ms
{ statusCode: 404,
path: '/',
message: 'This page could not be found' }
How to fix this?
In my Nuxt.js application, I installed the nuxt-i18n according to how the documentation suggests:
{
modules: [
['nuxt-i18n', {
// Options
}]
]
}
But when I run npm run dev, I get this error message:
DONE Compiled successfully in -4519ms 12:53:52
OPEN http://localhost:3000
nuxt:render Rendering url / +0ms
{ statusCode: 404,
path: '/',
message: 'This page could not be found' }
How to fix this?
Share Improve this question edited Sep 27, 2018 at 10:17 Billal BEGUERADJ asked Sep 27, 2018 at 9:57 Billal BEGUERADJBillal BEGUERADJ 22.8k45 gold badges123 silver badges140 bronze badges 4-
do you have a
pages/index.vue
file ? – Nicolas Pennec Commented Sep 27, 2018 at 11:51 - Yes, it is there by default (I mean I did not do any changes to that file) – Billal BEGUERADJ Commented Sep 27, 2018 at 12:09
- I reproduce your issue when the nuxt-i18n module is enable. – Nicolas Pennec Commented Sep 27, 2018 at 12:17
- Yes, exactly, ... and I am struggling with this issue the whole of today – Billal BEGUERADJ Commented Sep 27, 2018 at 12:24
2 Answers
Reset to default 4For the sake of pletion to @Nicolas Pennec -great- answer, and in order to avoid warning messages as this one: Locale ISO code is required to generate alternate link
, we should declare the locales as described in the documentation:
// nuxt.config.js
['nuxt-i18n', {
locales: [
{
code: 'en',
iso: 'en-US'
},
{
code: 'es',
iso: 'es-ES'
},
{
code: 'fr',
iso: 'fr-FR'
}
]
}]
it works fine if you set a default locale :)
modules: [
['nuxt-i18n', {
locales: ['en', 'fr', 'es'],
defaultLocale: 'en',
seo: false // workaround to fix the current issue on module https://github./nuxt-munity/nuxt-i18n/issues/127
}]
],
本文标签: javascriptNuxtjs message 39This page could not be found39 (nuxti18n)Stack Overflow
版权声明:本文标题:javascript - Nuxt.js: message: 'This page could not be found' (nuxt-i18n) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744152758a2593125.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论