收藏
回答

miniprogram-ci 上传编译文件 10009 undefined?

miniprogram-ci版本:1.8.35

开发工具上传无此问题,用ci工具上传执行文件编译的时候,出错,code: 10009


最后一次编辑于  2022-11-10
回答关注问题邀请回答
收藏

2 个回答

  • commy
    commy
    2022-11-10

    错误截图截完整一点?这个错误码表示你的 JSON 文件内容有问题

    2022-11-10
    有用
    回复 7
    • 岚枫
      岚枫
      2022-12-02
      完整错误信息如下
      ···
      "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=exports.checkPath=exports.ECheckPathType=exports.checkUTF
      8=exports.throwError=exports.getAllPagesInfo=exports.getAllPages=void 0;const tslib_1=require("tslib"),tools_1=require("./tools"),config_1=require("../config"),path_1=(0,tslib_1.__imp
      ortDefault)(require("path")),locales_1=(0,tslib_1.__importDefault)(require("./locales/locales")),getAllPages=e=>{const t=[...e.pages];if(e.subPackages)for(const o of e.subPackages)for
      (const e of o.pages)t.push((0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)));return t};exports.getAllPages=getAllPages;const getAllPagesInfo=e=>{const t=e.pages.map(e=>(
      {path:e,root:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT,name:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT}));if(e.subPackages)for(const o of e.subPackages)for(const e of o.pages)t.push({path:
      (0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)),root:o.root,name:o.name||""});return t};function throwError(e){const{msg:t,code:o=config_1.JSON_CONTENT_ERR,filePath:r}=
      e,a=new Error(`${r}: ${t}`);throw a.code=o,a.path=r,a}function checkUTF8(e,t){let o="";try{o=(0,tools_1.bufferToUtf8String)(e)}catch(e){o=""}return void 0===o&&throwError({msg:locales
      _1.default.config.FILE_NOT_UTF8.format(t),code:config_1.FILE_NOT_UTF8,filePath:t}),o}var ECheckPathType;function checkPath(e){const{value:t,tips:o,filePath:r="app.json",code:a=config_
      1.JSON_CONTENT_ERR,checkPathType:s=e.checkPathType||ECheckPathType.NORMAL}=e;"string"!==(0,tools_1.getType)(t)&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(
      [o,"string"]),code:a,filePath:r}),""===t&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format([o,"''"]),code:a,filePath:r}),t.includes("\\")&&throwError({msg:lo
      cales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"\\"]),code:a,filePath:r}),t.includes("//")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"//"])
      ,code:a,filePath:r}),s===ECheckPathType.NORMAL&&t.startsWith(".")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"."]),code:a,filePath:r}),s===ECheckPa
      thType.NORMAL&&t.startsWith("/")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"/"]),code:a,filePath:r}),t.startsWith(" ")&&throwError({msg:locales_1.
      default.config.JSON_SHOULD_NOT_START_WITH.format([o," "]),code:a,filePath:r}),(t.includes("../")||t.endsWith("/.."))&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.
      format([o,"../"]),code:a,filePath:r})}function getAllTargetTypeFilesWithOtherTypeFilesOfSameName(e,t,o,r){if(!t)return[];const a=e.getFileList(r,t);if(!o||0===o.length)return a;const
      s=o.map(t=>new Set(e.getFileList(r,t).map(e=>e.slice(0,-t.length))));return a.map(e=>e.slice(0,-t.length)).filter(e=>s.every(t=>t.has(e))).map(e=>`${e}${t}`)}exports.getAllPagesInfo=g
      etAllPagesInfo,exports.throwError=throwError,exports.checkUTF8=checkUTF8,function(e){e.NORMAL="NORMAL",e.TAB_BAR_ICON="TAB_BAR_ICON"}(ECheckPathType=exports.ECheckPathType||(exports.E
      CheckPathType={})),exports.checkPath=checkPath,exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=getAllTargetTypeFilesWithOtherTypeFilesOfSameName;














      Error: app.js: undefined
          at throwError (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\utils\common.js:2:1103)
          at f (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\core\compile\handler\js.js:2:2541)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at async compileJS (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\core\compile\handler\js.js:2:280
      1)
          at async Promise.all (index 0)
          at async compileJSFiles (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\core\compile\common.js:2:27
      16)
          at async compile (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\core\compile\mini_program.js:2:216
      3)
          at async innerUpload (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\ci\upload.js:2:1877)
          at async upload (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\ci\upload.js:2:975)
          at async Object.upload (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\utils\report.js:2:1403) { 
        code: 10009,
        path: 'app.js'
      }
       ···


      但是通过小程序开发工具上传是完全没有任何问题的,等于这2个构建上是有区别?
      2022-12-02
      回复
    • 岚枫
      岚枫
      2022-12-02
      重新附上整个输出日志:
      ```
      [doing] app.json
      [done] app.json
      [doing] views/index/index
      [done] views/index/index
      [doing] views/my/index
      [done] views/my/index
      [doing] views/common/webview
      [done] views/common/webview
      [doing] views/login/index
      [done] views/login/index
      [doing] views/index/detail
      [done] views/index/detail
      [doing] views/ic/AddEducation
      [done] views/ic/AddEducation
      [doing] views/common/Pay
      [done] views/common/Pay
      [doing] views/common/PaySuccess
      [done] views/common/PaySuccess
      [doing] views/ic/StartShoot
      [done] views/ic/StartShoot
      [doing] views/camera/index
      [done] views/camera/index
      [doing] views/ic/ConfirmPhoto
      [done] views/ic/ConfirmPhoto
      [doing] views/ic/AddPhoto
      [done] views/ic/AddPhoto
      [doing] views/ic/AddSubmitOrder
      [done] views/ic/AddSubmitOrder
      [doing] views/my/address/index
      [done] views/my/address/index
      [doing] views/my/address/detail
      [done] views/my/address/detail
      [doing] views/ic/SubmitOrder
      [done] views/ic/SubmitOrder
      [doing] views/my/order/index
      [done] views/my/order/index
      [doing] views/my/order/detail
      [done] views/my/order/detail
      [doing] components/customer-service/index
      [done] components/customer-service/index
      [doing] components/fixed-bottom/index
      [done] components/fixed-bottom/index
      [doing] components/load-refresh/index
      [done] components/load-refresh/index
      [doing] components/photo-type-choose/index
      [done] components/photo-type-choose/index
      [doing] components/user-info/index
      [done] components/user-info/index
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-badge/uni-badge
      [done] node-modules/@dcloudio/uni-ui/lib/uni-badge/uni-badge
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card
      [done] node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-data-checkbox/uni-data-checkbox
      [done] node-modules/@dcloudio/uni-ui/lib/uni-data-checkbox/uni-data-checkbox
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-data-picker/uni-data-picker
      [done] node-modules/@dcloudio/uni-ui/lib/uni-data-picker/uni-data-picker
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-data-pickerview/uni-data-pickerview
      [done] node-modules/@dcloudio/uni-ui/lib/uni-data-pickerview/uni-data-pickerview
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput
      [done] node-modules/@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms
      [done] node-modules/@dcloudio/uni-ui/lib/uni-forms/uni-forms
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item
      [done] node-modules/@dcloudio/uni-ui/lib/uni-forms-item/uni-forms-item
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons
      [done] node-modules/@dcloudio/uni-ui/lib/uni-icons/uni-icons
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-list/uni-list
      [done] node-modules/@dcloudio/uni-ui/lib/uni-list/uni-list
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item
      [done] node-modules/@dcloudio/uni-ui/lib/uni-list-item/uni-list-item
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-load-more/uni-load-more
      [done] node-modules/@dcloudio/uni-ui/lib/uni-load-more/uni-load-more
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-section/uni-section
      [done] node-modules/@dcloudio/uni-ui/lib/uni-section/uni-section
      [doing] node-modules/@dcloudio/uni-ui/lib/uni-segmented-control/uni-segmented-control
      [done] node-modules/@dcloudio/uni-ui/lib/uni-segmented-control/uni-segmented-control
      [doing] views/my/order/components/Order
      [done] views/my/order/components/Order
      [doing] compiling other files
      [done] compiling other files
      [doing] app.js
      [doing] common/vendor.js
      [doing] components/customer-service/index.js
      [doing] components/fixed-bottom/index.js
      [done] app.js
      [doing] components/load-refresh/index.js
      D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\utils\common.js:2
      "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=exports.checkPath=exports.ECheckPathType=exports.checkUTF
      8=exports.throwError=exports.getAllPagesInfo=exports.getAllPages=void 0;const tslib_1=require("tslib"),tools_1=require("./tools"),config_1=require("../config"),path_1=(0,tslib_1.__imp
      ortDefault)(require("path")),locales_1=(0,tslib_1.__importDefault)(require("./locales/locales")),getAllPages=e=>{const t=[...e.pages];if(e.subPackages)for(const o of e.subPackages)for
      (const e of o.pages)t.push((0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)));return t};exports.getAllPages=getAllPages;const getAllPagesInfo=e=>{const t=e.pages.map(e=>(
      {path:e,root:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT,name:config_1.MINI_PROGRAM_MAIN_PACKAGE_ROOT}));if(e.subPackages)for(const o of e.subPackages)for(const e of o.pages)t.push({path:
      (0,tools_1.normalizePath)(path_1.default.posix.join(o.root,e)),root:o.root,name:o.name||""});return t};function throwError(e){const{msg:t,code:o=config_1.JSON_CONTENT_ERR,filePath:r}=
      e,a=new Error(`${r}: ${t}`);throw a.code=o,a.path=r,a}function checkUTF8(e,t){let o="";try{o=(0,tools_1.bufferToUtf8String)(e)}catch(e){o=""}return void 0===o&&throwError({msg:locales
      _1.default.config.FILE_NOT_UTF8.format(t),code:config_1.FILE_NOT_UTF8,filePath:t}),o}var ECheckPathType;function checkPath(e){const{value:t,tips:o,filePath:r="app.json",code:a=config_
      1.JSON_CONTENT_ERR,checkPathType:s=e.checkPathType||ECheckPathType.NORMAL}=e;"string"!==(0,tools_1.getType)(t)&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_BE.format(
      [o,"string"]),code:a,filePath:r}),""===t&&throwError({msg:locales_1.default.config.JSON_CONTENT_SHOULD_NOT_BE.format([o,"''"]),code:a,filePath:r}),t.includes("\\")&&throwError({msg:lo
      cales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"\\"]),code:a,filePath:r}),t.includes("//")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.format([o,"//"])
      ,code:a,filePath:r}),s===ECheckPathType.NORMAL&&t.startsWith(".")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"."]),code:a,filePath:r}),s===ECheckPa
      thType.NORMAL&&t.startsWith("/")&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_START_WITH.format([o,"/"]),code:a,filePath:r}),t.startsWith(" ")&&throwError({msg:locales_1.
      default.config.JSON_SHOULD_NOT_START_WITH.format([o," "]),code:a,filePath:r}),(t.includes("../")||t.endsWith("/.."))&&throwError({msg:locales_1.default.config.JSON_SHOULD_NOT_CONTAIN.
      format([o,"../"]),code:a,filePath:r})}function getAllTargetTypeFilesWithOtherTypeFilesOfSameName(e,t,o,r){if(!t)return[];const a=e.getFileList(r,t);if(!o||0===o.length)return a;const
      s=o.map(t=>new Set(e.getFileList(r,t).map(e=>e.slice(0,-t.length))));return a.map(e=>e.slice(0,-t.length)).filter(e=>s.every(t=>t.has(e))).map(e=>`${e}${t}`)}exports.getAllPagesInfo=g
      etAllPagesInfo,exports.throwError=throwError,exports.checkUTF8=checkUTF8,function(e){e.NORMAL="NORMAL",e.TAB_BAR_ICON="TAB_BAR_ICON"}(ECheckPathType=exports.ECheckPathType||(exports.E
      CheckPathType={})),exports.checkPath=checkPath,exports.getAllTargetTypeFilesWithOtherTypeFilesOfSameName=getAllTargetTypeFilesWithOtherTypeFilesOfSameName;














      Error: app.js: undefined
          at throwError (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\utils\common.js:2:1103)
          at f (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\core\compile\handler\js.js:2:2541)
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at async compileJS (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\core\compile\handler\js.js:2:280
      1)
          at async Promise.all (index 0)
          at async compileJSFiles (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\core\compile\common.js:2:27
      16)
          at async compile (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\core\compile\mini_program.js:2:216
      3)
          at async innerUpload (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\ci\upload.js:2:1877)
          at async upload (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\ci\upload.js:2:975)
          at async Object.upload (D:\liyu\workspace\my-works\photo-collection-platform\node_modules\.pnpm\miniprogram-ci@1.8.35\node_modules\miniprogram-ci\dist\utils\report.js:2:1403) { 
        code: 10009,
        path: 'app.js'
      }
      D:\liyu\workspace\my-works\photo-collection-platform\packages\photo-collection-mini-program:
       ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @photo-collection/app@0.1.1 upload: `node ./upload-app.js`
      Exit status 1
       ELIFECYCLE  Command failed with exit code 1.


      Process finished with exit code 1
       ```
      2022-12-02
      回复
    • 岚枫
      岚枫
      2022-12-12
      能有解决方案吗?或者错误提示是否可以告知为什么编译错误
      2022-12-12
      回复
    • carpe_diem
      carpe_diem
      2023-02-22回复岚枫
      我也遇到这个问题了,请问最后怎么解决的?
      2023-02-22
      回复
    • 岚枫
      岚枫
      2023-02-24回复carpe_diem
      感觉没法解决,是他们写的这个cli问题,因为用开发工具上传是正常了,好烦。
      2023-02-24
      回复
    查看更多(2)
  • 无所谓
    无所谓
    2023-05-09

    如果你用的是 pnpm ,应该是找不到对应的依赖包,就会报 `Error: app.js: undefined`, 可以使用 pnpm 扁平化安装所以依赖

    pnpm install --shamefully-hoist

    2023-05-09
    有用 1
    回复 3
登录 后发表内容