seho20001123
seho20001123
  • 发布:2022-01-09 16:24
  • 更新:2022-01-10 21:04
  • 阅读:978

【报Bug】Vite TS uniapp项目编译报错

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: macos monterey m1

第三方开发者工具版本号: 3.3.5.20211229

基础库版本号: none

项目创建方式: CLI

CLI版本号: 3.0.0-alpha-3030420211227002

操作步骤:

成功编译

预期结果:

成功编译

实际结果:

成功编译

bug描述:

在进行vite迁移工作,在hbx中点击运行到小程序编译报错

直接使用npm可以成功运行dev

我也看了这里的vite插件实现,发现也设置了option watch,所以就看hbx调用的是什么命令了,可能这个命令有错误

2022-01-09 16:24 负责人:无 分享
已邀请:
seho20001123

seho20001123 (作者) - 菜鸟一个

让亚琪哥看看哈哈哈哈哈

DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

没能复现,你看吧你的lock文件还有package.json文件挪到一个空项目里面能复现这个问题吗

  • seho20001123 (作者)

    好的,我晚上试试,对了,你们cli创建项目的时候,会报错,应该是gitee问题,需要自己去gitee仓库下载,比较麻烦

    2022-01-10 18:19

seho20001123

seho20001123 (作者) - 菜鸟一个

我把packagejson放一下

{  
  "name": "sword-app",  
  "version": "1.2.0",  
  "private": true,  
  "scripts": {  
    "dev:app": "uni -p app",  
    "dev:custom": "uni -p",  
    "dev:h5": "uni",  
    "dev:h5:ssr": "uni --ssr",  
    "dev:mp-alipay": "uni -p mp-alipay",  
    "dev:mp-baidu": "uni -p mp-baidu",  
    "dev:mp-kuaishou": "uni -p mp-kuaishou",  
    "dev:mp-lark": "uni -p mp-lark",  
    "dev:mp-qq": "uni -p mp-qq",  
    "dev:mp-toutiao": "uni -p mp-toutiao",  
    "dev:mp-weixin": "uni -p mp-weixin",  
    "dev:quickapp-webview": "uni -p quickapp-webview",  
    "dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei",  
    "dev:quickapp-webview-union": "uni -p quickapp-webview-union",  
    "build:app": "uni build -p app",  
    "build:custom": "uni build -p",  
    "build:h5": "uni build",  
    "build:h5:ssr": "uni build --ssr",  
    "build:mp-alipay": "uni build -p mp-alipay",  
    "build:mp-baidu": "uni build -p mp-baidu",  
    "build:mp-kuaishou": "uni build -p mp-kuaishou",  
    "build:mp-lark": "uni build -p mp-lark",  
    "build:mp-qq": "uni build -p mp-qq",  
    "build:mp-toutiao": "uni build -p mp-toutiao",  
    "build:mp-weixin": "uni build -p mp-weixin",  
    "build:quickapp-webview": "uni build -p quickapp-webview",  
    "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei",  
    "build:quickapp-webview-union": "uni build -p quickapp-webview-union",  
    "lint": "eslint 'src/**/*' --fix",  
    "prettier": "prettier --write '**/*.{ts,js,json,markdown}'",  
    "lint-staged": "lint-staged"  
  },  
  "lint-staged": {  
    "*.{ts,js,json,markdown}": [  
      "prettier --write",  
      "eslint --fix",  
      "git add"  
    ]  
  },  
  "dependencies": {  
    "@dcloudio/uni-app": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-app-plus": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-components": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-h5": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-mp-alipay": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-mp-baidu": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-mp-kuaishou": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-mp-lark": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-mp-qq": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-mp-toutiao": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-mp-weixin": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-quickapp-webview": "^3.0.0-alpha-3030420211227002",  
    "@vue/shared": "^3.2.20",  
    "core-js": "^3.16.1",  
    "dayjs": "^1.10.7",  
    "flyio": "^0.6.14",  
    "marked": "^2.1.3",  
    "vue": "^3.2.26"  
  },  
  "devDependencies": {  
    "@babel/plugin-syntax-typescript": "^7.14.5",  
    "@dcloudio/types": "^2.5.15",  
    "@dcloudio/uni-automator": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/uni-cli-shared": "^3.0.0-alpha-3030420211227002",  
    "@dcloudio/vite-plugin-uni": "^3.0.0-alpha-3030520211229004",  
    "@types/node": "^16.10.3",  
    "@typescript-eslint/eslint-plugin": "^4.33.0",  
    "@typescript-eslint/parser": "^4.33.0",  
    "autoprefixer": "^10.4.0",  
    "concurrently": "^6.3.0",  
    "cross-env": "^7.0.2",  
    "esbuild-darwin-64": "^0.14.5",  
    "esbuild-node-tsc": "^1.8.2",  
    "eslint": "^7.32.0",  
    "eslint-config-prettier": "^8.3.0",  
    "eslint-plugin-prettier": "^4.0.0",  
    "husky": "^7.0.2",  
    "jest": "^25.4.0",  
    "lint-staged": "^11.2.2",  
    "miniprogram-api-typings": "^3.4.3",  
    "nodemon": "^2.0.13",  
    "prettier": "^2.4.1",  
    "sass": "^1.47.0",  
    "sword-typescript-type-core": "^1.0.3",  
    "tsbuffer-proto-generator": "^1.4.6",  
    "typescript": "^4.4.3",  
    "vite": "^2.7.7"  
  },  
  "browserslist": [  
    "Android >= 4",  
    "ios >= 8"  
  ],  
  "uni-app": {  
    "scripts": {}  
  }  
}  
seho20001123

seho20001123 (作者) - 菜鸟一个

好了,我解决了,src中的一个manifest.json有问题

seho20001123

seho20001123 (作者) - 菜鸟一个

你标记为已解决吧

该问题目前已经被锁定, 无法添加新回复