【18】微信小程序:微信开发者工具导入wepy-cli生成的项目后控制台报错显示app.json: app.json 未找到

解决“微信开发者工具导入wepy-cli生成的项目后控制台报错显示app.json: app.json 未找到”的问题

微信小程序开发者工具版本:【18】微信小程序:微信开发者工具导入wepy-cli生成的项目后控制台报错显示app.json: app.json 未找到_第1张图片

导入之前项目根目录下的project.config.json文件:

{
     
  "description": "A WePY project",
  "setting": {
     
    "urlCheck": true,
    "es6": false,
    "postcss": false,
    "minified": false
  },
  "compileType": "miniprogram",
  "appid": "	wx4e367dd65dd063b6",
  "projectname": "heima_ugou",
  "miniprogramRoot": "./dist"
}

导入之后项目根目录下的project.config.json文件被修改为:

{
     
  "description": "项目配置文件",
  "packOptions": {
     
    "ignore": []
  },
  "setting": {
     
    "urlCheck": true,
    "es6": true,
    "enhance": false,
    "postcss": true,
    "preloadBackgroundData": false,
    "minified": true,
    "newFeature": false,
    "coverView": true,
    "nodeModules": false,
    "autoAudits": false,
    "showShadowRootInWxmlPanel": true,
    "scopeDataCheck": false,
    "uglifyFileName": false,
    "checkInvalidKey": true,
    "checkSiteMap": true,
    "uploadWithSourceMap": true,
    "compileHotReLoad": false,
    "useMultiFrameRuntime": false,
    "useApiHook": true,
    "babelSetting": {
     
      "ignore": [],
      "disablePlugins": [],
      "outputPath": ""
    },
    "useIsolateContext": true,
    "useCompilerModule": true,
    "userConfirmedUseCompilerModuleSwitch": false,
    "packNpmManually": false,
    "packNpmRelationList": []
  },
  "compileType": "miniprogram",
  "libVersion": "2.13.1",
  "appid": "wx4e367dd65dd063b6",
  "projectname": "heima_ugou",
  "miniprogramRoot": "./dist",
  "debugOptions": {
     
    "hidedInDevtools": []
  },
  "scripts": {
     },
  "isGameTourist": false,
  "simulatorType": "wechat",
  "simulatorPluginLibVersion": {
     },
  "condition": {
     
    "search": {
     
      "current": -1,
      "list": []
    },
    "conversation": {
     
      "current": -1,
      "list": []
    },
    "game": {
     
      "current": -1,
      "list": []
    },
    "plugin": {
     
      "current": -1,
      "list": []
    },
    "gamePlugin": {
     
      "current": -1,
      "list": []
    },
    "miniprogram": {
     
      "current": -1,
      "list": []
    }
  }
}

问题原因:

导入项目后project.config.json文件被微信开发者工具修改,缺少代码:"miniprogramRoot": "./dist"从而导致微信开发者工具无法找到app.json文件进而报错:app.json: app.json 未找到

解决办法:

project.config.json文件中添加如下代码后从新编译即可:

"miniprogramRoot": "./dist"

你可能感兴趣的:(前端,前端,小程序,wepy)