uni-app QQ小程序预览、真机调试、上传后手机扫码首页报错:Page is not constructed because it is not found.
uni-app QQ小程序预览、真机调试、上传后手机扫码首页报错:Page is not constructed because it is not found.
开发环境 | 版本号 | 项目创建方式 |
---|---|---|
uni-starter | 未提及 | 未提及 |
在uni-starter上开发的项目,在h5,微信等真机、工具上都没问题,QQ开发者工具上也没问题,就是不能预览、真机、上传体验。进入后首页就是Page is not constructed because it is not found
2 回复
我也遇到这个问题了,请问咋解决的?
在 uni-app 开发 QQ 小程序时,遇到 Page is not constructed because it is not found.
的错误,通常是因为页面路径配置不正确或页面文件缺失导致的。以下是一些可能的解决方案:
1. 检查页面路径配置
确保在 pages.json
文件中正确配置了页面路径。例如:
{
"pages": [
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "首页"
}
},
{
"path": "pages/other/other",
"style": {
"navigationBarTitleText": "其他页面"
}
}
]
}
确保路径与实际文件路径一致,并且文件存在。
2. 检查页面文件是否存在
确保在 pages
目录下存在对应的页面文件。例如,如果配置了 pages/index/index
,那么应该在 pages/index
目录下存在 index.vue
文件。
3. 检查文件名和路径大小写
QQ 小程序对文件名和路径的大小写敏感,确保文件名和路径的大小写与配置一致。
4. 检查页面引入的组件路径
如果页面中引入了其他组件,确保组件路径正确。例如:
<template>
<view>
<my-component></my-component>
</view>
</template>
<script>
import MyComponent from '@/components/MyComponent.vue';
export default {
components: {
MyComponent
}
}
</script>