完整错误
jsEnginScriptError:
Component is not found in path "components/comp/comp.js" (using by pages/index/index); onAppRoute
Error: Component is not found in path "components/comp/comp.js" (using by pages/index/index)
in e(...)
...
错误代码(json)
{
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeApp",
"navigationBarTextStyle": "black",
"usingComponents": {
"MyComp": "../../components/comp/comp.js"
}
}
解决
去掉.js, 改为../../components/comp/comp:
{
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "WeApp",
"navigationBarTextStyle": "black",
"usingComponents": {
"MyComp": "../../components/comp/comp"
}

本文详细描述了在WeApp开发中遇到的组件路径配置错误,具体表现为找不到指定的.js文件。通过调整路径配置,去掉.js扩展名,成功解决了这一问题。
3653

被折叠的 条评论
为什么被折叠?



