chenquincy / app-info-parser

A javascript parser for parsing .ipa or .apk files. IPA/APK文件 js 解析器
MIT License
492 stars 116 forks source link

vue-cli3 打包部署后报错 #64

Closed whapply closed 3 years ago

whapply commented 3 years ago

描述 bug vue-cli3 打包部署到服务器后报错 s.inherits is not a function

复现 请描述复现该bug的步骤:

  1. vue-cli3 打包命令 vue-cli-service build --mode test 将包部署到服务器后, 访问该页面报错 s.inherits is not a function

请填写您的Node或浏览器版本:

chenquincy commented 3 years ago

@whapply 请提供更详细的报错信息

haomaigege commented 3 years ago

同样的报错,详细错误栈信息如下:

TypeError: util.inherits is not a function
    at node_modules/streamifier/lib/index.js (index.js:23)
    at __require2 (chunk-IHTDASF6.js?v=e28aaaaa:17)
    at Object.<anonymous> (index.js:25)
    at node_modules/cgbi-to-png/index.js (index.js:151)
    at __require2 (chunk-IHTDASF6.js?v=e28aaaaa:17)
    at node_modules/app-info-parser/src/ipa.js (ipa.js:41)
    at __require2 (chunk-IHTDASF6.js?v=e28aaaaa:17)
    at node_modules/app-info-parser/src/index.js (index.js:11)
    at __require2 (chunk-IHTDASF6.js?v=e28aaaaa:17)
    at dep:app-info-parser:1
chenquincy commented 3 years ago

@haomaigege @whapply 这个问题是 vite 的构建机制导致的,和 app-info-parser 无关,参考:https://github.com/vitejs/vite/issues/2985

我没办法修改依赖库的代码,目前看没什么好的解决办法,建议通过 cdn 方式引入 app-info-parser

arrosev commented 2 years ago

请问未打包之前在开发模式测试是否正常?