wechat-miniprogram / miniprogram-simulate

小程序自定义组件测试工具集
MIT License
501 stars 66 forks source link

组件路径和 __wxConfig is not defined #68

Closed fangdown closed 3 years ago

fangdown commented 4 years ago

"usingComponents": { // "uploader": "/components/uploader/uploader" "uploader": "../uploader/uploader" } 1, 组件路径usingComponents原先为绝对路径,simulate.load报路径错误 2, usingComponents改成相对路径后, 报 __wxConfig is not defined ● Test suite failed to run

ReferenceError: __wxConfig is not defined

请问这个有关系吗? 该如何解决

JuneAndGreen commented 3 years ago

miniprogram-simulate 里面应该没有依赖 __wxConfig 这个变量,你是有使用了什么第三方库用到了这个么?是否方便提供一下 demo?

fangxxiaoming commented 3 years ago

"usingComponents": { // "uploader": "/components/uploader/uploader" "uploader": "../uploader/uploader" } 1, 组件路径usingComponents原先为绝对路径,simulate.load报路径错误 引用绝对路径的问题我也遇到了,请问您解决了吗

JuneAndGreen commented 3 years ago

绝对路径问题,需要调整 rootPath:https://github.com/wechat-miniprogram/miniprogram-simulate/blob/master/docs/api.md#options

相对路径报 __wxConfig 问题,已排查过此工具及依赖不存在此变量依赖,请检查一下业务代码及其依赖中是否依赖了此变量