在mac上也有这个问题. 命令行里 --project-path 写相对路径这里也过不了. 必须写绝对路径才能解决这个问题.
Sass或者Less开发,在windows使用miniprogram-ci 上传代码失败?Sass或者Less开发,在windows使用miniprogram-ci 上传代码时报错,但是用开发工具可以正常上传代码,错误信息如下: { type: 'SummerError', message: 'The file (C:\\hp-work\\TestMiniProgram\\miniprogram\\styles\\variable.less) required by app.less is outside the project', stack: undefined, code: 10046, path: 'miniprogram/app.less', plugin: 'summer-less', hook: 'load' } [图片] 分析定位后找到报错位置 miniprogram-ci -> dist -> summer ->graph -> basegraph.js -> loadSourceForModule -> addWatchFile 方法 if (!i.startsWith(this.rootPath)) throw (0, error_1.makeSummerError)( `The file (${t}) required by ${e.sourcePath} is outside the project`, error_1.SummerErrors.SUMMER_PLUGIN_CODE_ERR, e.path ); 在该方法里面输出 i,以及 this.rootPath console.log('loadSourceForModule i--->', i) console.log('loadSourceForModule rootPath--->', this.rootPath) 在控制台可以看到相关信息: loadSourceForModule i---> C:/hp-work/TestMiniProgram/miniprogram/styles/variable.less loadSourceForModule rootPath---> C:\hp-work\TestMiniProgram/\miniprogram 可以发现是i 和 rootPath的格式不一致导致的该问题。 处理方式,将两个path的格式改成一致即可: addWatchFile: (t) => { const i = (0, tools_1.normalizePath)(t); const _r = (0, tools_1.normalizePath)(this.rootPath) if (!i.startsWith(_r)) throw (0, error_1.makeSummerError)( `The file (${t}) required by ${e.sourcePath} is outside the project`, error_1.SummerErrors.SUMMER_PLUGIN_CODE_ERR, e.path ); e.addWatchFile(path_1.default.posix.relative(this.rootPath, i)); }, 重新打包上传,上传成功 希望官方看到后尽快将这个问题修复,该问题只在window平台上发生 相关BUG: https://developers.weixin.qq.com/community/develop/doc/00086410108d58836c6d9995151000?highLine=is%2520outside%2520the%2520project
2022-04-18