o***@icloud.com
o***@icloud.com
  • 发布:2024-05-27 16:15
  • 更新:2024-05-28 23:22
  • 阅读:83

【报Bug】NVUE提示错误,Suspicious use of the "!" operator inside the "instanceof" operator

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 11

HBuilderX类型: 正式

HBuilderX版本号: 4.15

手机系统: Android

手机系统版本号: Android 12

手机厂商: 小米

手机机型: 小米

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

不清楚

预期结果:

解决问题

实际结果:

不清楚

bug描述:

云打包时候根本无法打包,提示错误。这个错误是nvue自己编译之后生成的代码吧?不是我写的。。

▲ [WARNING] Suspicious use of the "!" operator inside the "instanceof" operator [suspicious-boolean-not]
16:11:36.568 dist/dev/.nvue/pages/main/garbageTruckRoute/index.js:10295:8:
16:11:36.581 10295 │ if (!e instanceof Array) {
16:11:36.594 │ ~~
16:11:36.605 ╵ (!e)
16:11:36.616 The code "!x instanceof y" is parsed as "(!x) instanceof y". You need to insert parentheses to get "!(x instanceof y)" instead.
16:11:36.629 ▲ [WARNING] Suspicious use of the "!" operator inside the "instanceof" operator [suspicious-boolean-not]
16:11:36.638 dist/dev/.nvue/pages/main/garbageTruckRoute/index.js:11123:8:
16:11:36.651 11123 │ if (!l instanceof Array) {
16:11:36.664 │ ~~
16:11:36.676 ╵ (!l)
16:11:36.688 The code "!x instanceof y" is parsed as "(!x) instanceof y". You need to insert parentheses to get "!(x instanceof y)" instead.
16:11:36.701 ▲ [WARNING] Comparison with NaN using the "==" operator here is always false [equals-nan]
16:11:36.712 dist/dev/.nvue/pages/main/garbageTruckRoute/index.js:13412:10:
16:11:36.724 13412 │ if (f == NaN) {
16:11:36.737 ╵ ~~
16:11:36.749 Floating-point equality is defined such that NaN is never equal to anything, so "x === NaN" always returns false. You need to use "Number.isNaN(x)" instead to test for NaN.

2024-05-27 16:15 负责人:无 分享
已邀请:
o***@icloud.com

o***@icloud.com (作者)

很急,求求各位大佬。。幫忙看看

o***@icloud.com

o***@icloud.com (作者)

我用mac打包提示这个错误,但是不耽误后续继续打包。。我用win本打包就卡在这里。。
我用mac打包提示这个错误,但是不耽误后续继续打包。。我用win本打包就卡在这里。。
我用mac打包提示这个错误,但是不耽误后续继续打包。。我用win本打包就卡在这里。。
我用mac打包提示这个错误,但是不耽误后续继续打包。。我用win本打包就卡在这里。。

o***@icloud.com

o***@icloud.com (作者)

不是吧。。。没人有这个问题吗

喜欢技术的前端

喜欢技术的前端 - QQ---445849201

pages/main/garbageTruckRoute.vue 这个页面的代码可以贴下

  • o***@icloud.com (作者)

    大佬。。我再排查问题的时候,发现是nvue调用接口的时候出的问题,我封装了一个request的类,就uni.request相关的。。只要我不请求接口,打包就没问题,只要取消注释请求接口的代码他就报错。。

    2024-05-31 14:22

  • o***@icloud.com (作者)

    // import jsrsasign from 'jsrsasign';是这个包的错。。。注释掉他就能打包了。但是无法解析token

    2024-05-31 14:35

要回复问题请先登录注册