Akryum / Akryum/floating-vue

Node 24 warns `(node:80288) TimeoutNaNWarning: NaN is not a number.`

Đang mở
#1,086 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
3.5k
Fork
341
Merge trung bình
14 phút
Pull request đã merge (30 ngày)
8

Mô tả

After upgrading to node 24 i get the warning:

```
(node:80288) TimeoutNaNWarning: NaN is not a number.
Timeout duration was set to 1.
(Use `node --trace-warnings ...` to show where the warning was created)
```

It looks like this line is the problem: https://github.com/Akryum/floating-vue/blob/19857764c4f73dea7ed44a7d970adb968ee7ad90/packages/floating-vue/src/components/Popper.ts#L714

It looks like when delay[type] is `0` (eg `{hide: 0}`) then it is falsy and fals back to `delay`. Then it tries to `parseInt({hide: 0})` itself which result in NaN.

Probably just `return parseInt((delay && delay[type]) || delay) || 0` is enough to fix it so that it is definitely a number

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.