uniapp项目启动报错:Uncaught TypeError: Cannot read property ‘meta‘ of undefined处理方案

简介: 刚入门uniapp,简单记录一下希望对有同样问题的小伙伴有所帮助,尽量少浪费时间.

  刚入门uniapp,简单记录一下希望对有同样问题的小伙伴有所帮助,尽量少浪费时间.

   新创建的uniapp项目,项目启动之后就报错,是不是很挫败,第一步就有问题!!!具体报错信息如下:

Uncaught TypeError: Cannot read property 'meta' of undefined

控制台截图:

44298408070e21e353bebcf903d1a3fd_8aa74c43fe5d435790c446fa6a0f3b45.png

   发现将pages.json中的tabbar节点全部注释掉之后启动正常,进一步来看将tabbar中的list属性注释掉之后项目启动也是正常的.到这里就是页面路径的问题.仔细观察发现项目pages下面的页面路径信息没有配置,导致tabbar中加载页面异常,按照页面加载顺序补充完整即可.项目启动是按照pages下面的页面的顺序进行加载,有文件但是配置中没有加载就会报错,tabbar的list属性中再去找对应的页面更会报错.正常的pages页面配置如下:

pages对象:

"pages": [ 
    {
      "path": "pages/index/index",
      "style": {
        "navigationBarTitleText": "uni-app"
      }
    },
    {
      "path": "pages/message/message",
      "style": {
        "navigationBarTitleText": "",
        "enablePullDownRefresh": false
      }
    }
  ]


页面截图:

c7ccdf8e16c03d0b408f58766a94ca31_11e5c9ece26a42d6a24ead9fa4033095.png

tabbar页面配置:

"tabBar": { //底部
    "color": "#999999",
    "selectedColor": "#09C160",
    "borderStyle": "black",
    "backgroundColor": "#ffffff",
    "list": [{
        "pagePath": "pages/index/index",
        "text": "首页"
      },
      {
        "pagePath": "pages/message/message",
        "text": "消息"
      }
    ]
  }


页面截图如下:

435a29eb0a06bdbd2a7fbc8a48cf8715_b5b77462eb5c431fa28d74a049b47e44.png


目录
打赏
0
0
0
0
5
分享
相关文章
成功解决:Cannot read properties of undefined (reading ‘commit‘)
这篇文章提供了解决Vuex中"Cannot read properties of undefined (reading 'commit')"错误的两种方法:检查模板中的数据属性是否存在,以及确保在Vue实例中正确挂载了store对象。
成功解决:Cannot read properties of undefined (reading ‘commit‘)
Echarts——Invalid geoJson format Cannot read property 'length' of undefined
Echarts——Invalid geoJson format Cannot read property 'length' of undefined
140 0
|
7月前
|
VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined
VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined
163 0
基于SpringBoot+Vue+uniapp的房屋租赁App的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue+uniapp的房屋租赁App的详细设计和实现(源码+lw+部署文档+讲解等)
172 7
基于SpringBoot+Vue+uniapp的房屋租赁App的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue+uniapp的汉服交易小程序的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue+uniapp的汉服交易小程序的详细设计和实现(源码+lw+部署文档+讲解等)
98 7
基于SpringBoot+Vue+uniapp的宠物医院微信小程序的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue+uniapp的宠物医院微信小程序的详细设计和实现(源码+lw+部署文档+讲解等)
132 7
基于SpringBoot+Vue+uniapp的武汉市公交路线查询系统的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue+uniapp的武汉市公交路线查询系统的详细设计和实现(源码+lw+部署文档+讲解等)
154 7
基于SpringBoot+Vue+uniapp的旅游攻略系统的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue+uniapp的旅游攻略系统的详细设计和实现(源码+lw+部署文档+讲解等)
163 7
基于SpringBoot+Vue+uniapp的成人教育APP的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue+uniapp的成人教育APP的详细设计和实现(源码+lw+部署文档+讲解等)
125 7
基于SpringBoot+Vue+uniapp的大学生勤工助学管理系统的详细设计和实现(源码+lw+部署文档+讲解等)
基于SpringBoot+Vue+uniapp的大学生勤工助学管理系统的详细设计和实现(源码+lw+部署文档+讲解等)
148 7

热门文章

最新文章