Nuxt.js:消息:“找不到此页面"(nuxt-i18n) [英] Nuxt.js: message: 'This page could not be found' (nuxt-i18n)
本文介绍了Nuxt.js:消息:“找不到此页面"(nuxt-i18n)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 Nuxt.js 应用程序中,我根据 文档 建议:
<预><代码>{模块: [['nuxt-i18n', {//选项}]]}但是当我运行 npm run dev 时,我收到此错误消息:
DONE 在-4519ms 12:53:52 编译成功打开 http://localhost:3000nuxt:render 渲染 url/+0ms{ 状态码:404,小路: '/',消息:'无法找到此页面' }
如何解决这个问题?
解决方案
如果您设置默认语言环境,它就可以正常工作:)
模块:[['nuxt-i18n', {语言环境:['en', 'fr', 'es'],defaultLocale: 'en',seo: false//解决模块 https://github.com/nuxt-community/nuxt-i18n/issues/127 当前问题的解决方法}]],
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?
解决方案
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.com/nuxt-community/nuxt-i18n/issues/127
}]
],
这篇关于Nuxt.js:消息:“找不到此页面"(nuxt-i18n)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文