首页 > 编程语言 >微信小程序报错:Component is not found in path "components/comp/comp.js"

微信小程序报错:Component is not found in path "components/comp/comp.js"

时间:2024-09-08 20:39:46浏览次数:13  
标签:index .. comp Component js 报错 components 微信

完整错误

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"
}

标签:index,..,comp,Component,js,报错,components,微信
From: https://www.cnblogs.com/stanleys/p/18403378/wmp-component-not-found

相关文章