Error0
Error0
  • 发布:2022-01-06 21:10
  • 更新:2023-04-11 17:18
  • 阅读:1694

【报bug】新版的hbuilderx 项目报错了,旧版Hbuilder可以正常运行

分类:HBuilderX

[广告] 21:06:02.031 开源不易,需要鼓励。去给 uni-app 项目 点个 star 吧 [不再提示]
[广告] 21:06:02.032 DCloud 2022新春招聘开启,欢迎前端、Android、C++/QT来投简历! 详情点击
21:06:02.089 项目 'wisdom-tree' 开始编译...
21:06:02.709 请注意运行模式下,因日志输出、sourcemap以及未压缩源码等原因,性能和包体积,均不及发行模式。
21:06:02.775 正在编译中...
21:06:03.279 INFO Starting development server...
21:06:20.208 [tsl] ERROR at music/index.ts:59
21:06:20.214 TS7008:Member '_events' implicitly has an 'any' type.
21:06:20.214 [tsl] ERROR at music/index.ts:162
21:06:20.221 TS2403:Subsequent variable declarations must have the same type. Variable 'audioCtx' must be of type 'BackgroundAudioManager', but here has type 'InnerAudioContext'.
21:06:20.222 [tsl] ERROR at music/index.ts:163
21:06:20.234 TS2339:Property 'autoplay' does not exist on type 'BackgroundAudioManager'.
21:06:20.235 [tsl] ERROR at music/index.ts:283
21:06:20.241 TS7017:Element implicitly has an 'any' type because type 'ZAudio' has no index signature.
21:06:20.242 [tsl] ERROR at music/index.ts:475
21:06:20.251 TS7015:Element implicitly has an 'any' type because index expression is not of type 'number'.
21:06:20.252 [tsl] ERROR at music/index.ts:476
21:06:20.259 TS7015:Element implicitly has an 'any' type because index expression is not of type 'number'.
21:06:20.268 [tsl] ERROR at music/index.ts:477
21:06:20.275 TS7015:Element implicitly has an 'any' type because index expression is not of type 'number'.
21:06:20.284 [tsl] ERROR at music/index.ts:478
21:06:20.285 TS7015:Element implicitly has an 'any' type because index expression is not of type 'number'.
21:06:20.292 [tsl] ERROR at music/index.ts:518
21:06:20.292 TS2339:Property 'getSystemService' does not exist on type 'PlusAndroidInstanceObject'.
21:06:20.301 [tsl] ERROR at music/index.ts:518
21:06:20.308 TS2339:Property 'TELEPHONY_SERVICE' does not exist on type 'PlusAndroidClassObject'.
21:06:20.308 [tsl] ERROR at music/index.ts:527
21:06:20.318 TS2345:Argument of type '{ getStringExtra: (arg0: any) => any; }' is not assignable to parameter of type 'string | PlusAndroidInstanceObject'.
21:06:20.318 Type '{ getStringExtra: (arg0: any) => any; }' is not assignable to type 'PlusAndroidInstanceObject'.
21:06:20.326 Property 'plusGetAttribute' is missing in type '{ getStringExtra: (arg0: any) => any; }'.
21:06:20.334 [tsl] ERROR at music/index.ts:533
21:06:20.335 TS2339:Property 'getSystemService' does not exist on type 'PlusAndroidInstanceObject'.
21:06:20.342 [tsl] ERROR at music/index.ts:533
21:06:20.342 TS2339:Property 'TELEPHONY_SERVICE' does not exist on type 'PlusAndroidClassObject'.
21:06:20.357 [tsl] ERROR at music/index.ts:534
21:06:20.365 TS2339:Property 'getCallState' does not exist on type 'PlusAndroidClassObject'.
21:06:20.377 [tsl] ERROR at music/index.ts:536
21:06:20.384 TS2339:Property 'EXTRA_INCOMING_NUMBER' does not exist on type 'PlusAndroidClassObject'.
21:06:20.392 [tsl] ERROR at music/index.ts:548
21:06:20.393 TS2351:Cannot use 'new' with an expression whose type lacks a call or construct signature.
21:06:20.401 [tsl] ERROR at music/index.ts:549
21:06:20.401 TS2339:Property 'ACTION_PHONE_STATE_CHANGED' does not exist on type 'PlusAndroidClassObject'.
21:06:20.410 [tsl] ERROR at music/index.ts:550
21:06:20.410 TS2339:Property 'registerReceiver' does not exist on type 'PlusAndroidInstanceObject'.
21:06:20.418 [tsl] ERROR at music/index.ts:557
21:06:20.418 TS7006:Parameter 'ctCall' implicitly has an 'any' type.
21:06:20.426 [tsl] ERROR at zaudio/index.ts:59
21:06:20.426 TS7008:Member '_events' implicitly has an 'any' type.
21:06:20.434 [tsl] ERROR at zaudio/index.ts:283
21:06:20.435 TS7017:Element implicitly has an 'any' type because type 'ZAudio' has no index signature.
21:06:20.443 [tsl] ERROR at zaudio/index.ts:475
21:06:20.443 TS7015:Element implicitly has an 'any' type because index expression is not of type 'number'.
21:06:20.468 [tsl] ERROR at zaudio/index.ts:476
21:06:20.484 TS7015:Element implicitly has an 'any' type because index expression is not of type 'number'.
21:06:20.485 [tsl] ERROR at zaudio/index.ts:477
21:06:20.493 TS7015:Element implicitly has an 'any' type because index expression is not of type 'number'.
21:06:20.493 [tsl] ERROR at zaudio/index.ts:478
21:06:20.518 TS7015:Element implicitly has an 'any' type because index expression is not of type 'number'.

2022-01-06 21:10 负责人:无 分享
已邀请:
Error0

Error0 (作者)

我现在没有办法确认这些ts文件有没有被引用,有没有一种方法可以忽略这些错误

  • 赵永强

    tsconfig.json里面"strict": true,改为false

    2022-01-06 22:10

  • Error0 (作者)

    回复 赵永强: 感谢大佬,少了很多错误,剩下的错误我使用 // @ts-ignore解决了

    2022-01-06 22:22

Error0

Error0 (作者)

额,真的是尴尬,根据报错去查找,果然发现了很多ts的语法错误,无奈自己没有办法去改,把ts文件删掉就不报错了

者行孙

者行孙

我自己的cli项目用eslint用的好好的,结果新版本来了一出tslint导致包都打不了

benleilei

benleilei

打开【HBuilder X(3.4.14)】安装目录,打开 \HBuilderX安装目录\plugins\compile-typescript 目录

  1. 修改 package.json 文件:把 dependencies 中的 typescript 版本换成 4.6.3
  2. 打开 node_modules 目录,里边有个 typescript 目录,换成 4.6.3 版本的文件

重新启动 HBuilder X 后编译,修正语法错误后通过

  • 飞天遁地猪

    你好,我更新到版本363也出现这个问题,请问也是一样操作嘛

    2022-09-21 09:56

g***@126.com

g***@126.com

准备劝退了,瞎搞什么tslint,发现现在的版本连tsconfig都没有,想关都关不了

飞天遁地猪

飞天遁地猪

楼主修改好了嘛,我的问题和你的基本一致

1***@qq.com

1***@qq.com

楼主请问怎么解决的,我设置strict false然后后面解决不了了,还是全部都是报错,都是TS问题,升级TS版本也不行

  • Error0 (作者)

    ts-ignore

    2023-04-11 17:04

Error0

Error0 (作者)

ts-ignore

要回复问题请先登录注册