javascript - 将 Nuxt 迁移到 2.7:刷新循环
问题描述
我正在将 Nuxt.js 项目从 迁移Nuxt@1.4
到2.7
,并根据需要更新 Webpack 配置等。我现在遇到以下错误。
当我尝试访问网站上的任何页面时,我点击了显示捆绑进度的股票 Nuxt 加载屏幕,然后立即无限刷新。应用程序永远不会越过这个屏幕,并且选项卡标题永远不会从Nuxt.js: Loading app...
.
控制台中没有错误,也没有任何编译时错误,但是当我转到 devtools 网络选项卡时,我看到一个失败的(HTTP 500)请求localhost:3000
,并带有以下错误作为响应负载:
NuxtServerError
render function or template not defined in component: NuxtLoading
我查看了 NuxtLoading,我能找到的唯一引用是文件.nuxt
夹中名为的文件nuxt-loading.vue
,它看起来像一个正常运行的组件。它有一个render()
方法,实现如下:
render(h) {
let el = h(false)
if (this.show) {
el = h('div', {
staticClass: 'nuxt-progress',
class: {
'nuxt-progress-notransition': this.skipTimerCount > 0,
'nuxt-progress-failed': !this.canSucceed
},
style: {
'width': this.percent + '%',
'left': this.left
}
})
}
return el
}
我试过的:
- 重新安装
node_modules
; rm -rf .nuxt && yarn dev
(编辑:和yarn.lock
);- 升级
element-ui
到最新版本。
提前感谢您的帮助。如果需要更多信息,请询问。
解决方案
您对 i18n 加载程序的配置有误。它应该是这样的:
config.module.rules.push({
resourceQuery: /blockType=i18n/,
type: 'javascript/auto',
loader: '@kazupon/vue-i18n-loader'
});
或者您可以使用nuxt-i18n模块,它将使用vueI18nLoader 选项为您设置。
推荐阅读
- https - 如何在 https 上运行 0.0.0.0?
- excel - Excel 公式如果一个值与某个单元格区域中的值匹配,则返回不同单元格中的相应值
- apache-spark - S3 doesObjectExist API 无法识别等号路径
- node.js - 离子错误:SPAWN EACCES
- spring - 为 Spring Controller 执行 JUnit 测试用例时出现 I/O 错误
- macos - mac os high sierra - 找不到用户文件夹
- spring - SpringBoot 读取所有属性为 0
- angular - How to check if an array contains a specific value?
- c - 混合 C++ 和 C 代码 - VS10 中的链接器问题
- ios - 如何在表格视图单元格滑动动作中设置清晰的背景?