【问题标题】:Vue|Nuxt - Copy project to production server leads to errorVue|Nuxt - 将项目复制到生产服务器导致错误
【发布时间】:2020-07-07 10:21:34
【问题描述】:

我做了什么:

  • 已删除本地node_modules 文件夹
  • 复制到我们的生产服务器
  • npm install
  • npm run dev

我的预期:

在我的开发人员工作站上启动和运行的应用程序

发生了什么:

应用程序抛出错误:Cannot read property 'props' of undefined

截图:

您可能想在此处添加代码和终端输出

【问题讨论】:

  • 嗨 Viacheslav,很高兴有你在这里。我可以建议您稍微更新一下您的问题。对于代码,我们不使用屏幕截图,而是复制并粘贴它。将```放在代码前后的行中,它将很好地格式化。我更新了文字,希望你能接受它

标签: node.js vue.js nuxt.js


【解决方案1】:

splitChunks.layouts 必须为 false

nuxt.config.js

 splitChunks: {
      layouts: false, // in my case, it was true
      pages: true,
    },

【讨论】:

    【解决方案2】:

    删除 package-lock.json 文件并再次尝试“npm install”。谢谢

    【讨论】:

    • 同样的错误 ERROR [Vue warn]: Invalid component name: "_6f6c098b". Component names should conform to valid custom element name in html5 specification.
    • const _6f6c098b = () => import('..\\layouts\\default.vue' /* webpackChunkName: "layouts_default" */).then(m => m.default || m) const _103c6d61 = () => import('..\\layouts\\landing.vue' /* webpackChunkName: "layouts_landing" */).then(m => m.default || m) const _82e1354c = () => import('..\\layouts\\testing.vue' /* webpackChunkName: "layouts_testing" */).then(m => m.default || m) const layouts = { "_default": sanitizeComponent(_6f6c098b),"_landing": sanitizeComponent(_103c6d61),"_testing": sanitizeComponent(_82e1354c) } let resolvedLayouts = {} export default { render (h, props) {
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-17
    • 2023-04-02
    • 1970-01-01
    • 2015-10-02
    • 2023-03-25
    • 2021-10-23
    相关资源
    最近更新 更多