question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

InputNumber cause Uncaught TypeError

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

http://www.example.com

Steps to reproduce

Add <InputNumber />, if click keyboard, it will cause this error. Or if put value in, it will directly cause error: <InputNumber value={10} />

If downgrade to antd 4.9.3, it is correct, no problem.

What is expected?

Act normally.

What is actually happening?

Uncaught TypeError: Cannot read property 'toString' of undefined
    at BigIntDecimal.getIntegerStr (MiniDecimal.js:149)
    at BigIntDecimal.toString (MiniDecimal.js:242)
    at triggerValueUpdate (InputNumber.js:249)
    at collectInputValue (InputNumber.js:284)
    at onInternalInput (InputNumber.js:308)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
    at invokeGuardedCallback (react-dom.development.js:4056)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4070)
    at executeDispatch (react-dom.development.js:8243)
    at processDispatchQueueItemsInOrder (react-dom.development.js:8275)
    at processDispatchQueue (react-dom.development.js:8288)
    at dispatchEventsForPlugins (react-dom.development.js:8299)
    at eval (react-dom.development.js:8508)
    at batchedEventUpdates$1 (react-dom.development.js:22396)
    at batchedEventUpdates (react-dom.development.js:3745)
    at dispatchEventForPluginEventSystem (react-dom.development.js:8507)
    at attemptToDispatchEvent (react-dom.development.js:6005)
    at dispatchEvent (react-dom.development.js:5924)
    at unstable_runWithPriority (scheduler.development.js:468)
    at runWithPriority$1 (react-dom.development.js:11276)
    at discreteUpdates$1 (react-dom.development.js:22413)
    at discreteUpdates (react-dom.development.js:3756)
    at dispatchDiscreteEvent (react-dom.development.js:5889)
Environment Info
antd 4.15.0
React 17.0
System Mac OSX
Browser Chrome 90

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dpzxsmcommented, Jul 7, 2021

@fengerzh 确实是这样的,我刚好也用到了这个rsa加密库,感谢

1reaction
fengerzhcommented, Jul 6, 2021

最后找到问题的根源是在另外一个地方有如下这样的定义:

  $w.BigInt = function (flag) {
    if (typeof flag === 'boolean' && flag === true) {
      this.digits = null;
    } else {
      this.digits = ZERO_ARRAY.slice(0);
    }
    this.isNeg = false;
  };

  RSAUtils.setMaxDigits = function (value) {
    maxDigits = value;
    ZERO_ARRAY = new Array(maxDigits);
    for (let iza = 0; iza < ZERO_ARRAY.length; iza += 1) ZERO_ARRAY[iza] = 0;
    bigZero = new BigInt();
    bigOne = new BigInt();
    bigOne.digits[0] = 1;
  };
  RSAUtils.setMaxDigits(20);

BigInt重复定义导致的冲突,把BigInt改名之后就好了。

Read more comments on GitHub >

github_iconTop Results From Across the Web

InputNumber: JavaScript errors when used inside composite ...
Uncaught TypeError: Cannot read property 'replace' of undefined at bK.bB (inputnumber.js.xhtml?ln=primefaces&v=8.0:14).
Read more >
WidgetVar InputNumber Primefaces 6.1 not working
I'm migrate from Primefaces 5.2 to 6.1. But, I was using widgetVar in inputNumber, for resolving operations ...
Read more >
HTMLInputElement.stepUp() - Web APIs | MDN
The HTMLInputElement.stepUp() method increments the value of a numeric type of element by the value of the step attribute, or the default ...
Read more >
JavaScript undefined Property - W3Schools
The undefined property indicates that a variable has not been assigned a value, or not declared at all. Browser Support. undefined() is an...
Read more >
InputNumber - Ant Design
Enter a number within certain range with the mouse or keyboard. When To Use. When a numeric value needs to be provided. Examples....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found