This module is referencing one or more HSPs and cannot be previewed. To preview components in an HSP, switch to the HSP first.

不知道大家遇见这个问题没有   是因为我们在使用name跳转别的模块的页面时   引入了hsp模块进来 所以他在编译的时候 告诉我们这个模块中引入了别的模块 那么怎么解决呢  只需要将你此模块中的oh-package.json中引入的包注释掉或者删除掉

  还有一个就是页面中引入的别的模块的路径也删除掉

然后重新编译打包 预览器就可以用了

Logo

讨论HarmonyOS开发技术,专注于API与组件、DevEco Studio、测试、元服务和应用上架分发等。

更多推荐