From 1bb5647a2b8246b23cbfff7a4a4148c7e8b10ed4 Mon Sep 17 00:00:00 2001 From: nikolas Date: Sat, 24 Feb 2024 16:06:45 -0500 Subject: [PATCH] Import Decimal from decimal.js rather than decimal.mjs The `decimal.js` package provides the decimal.js as well as decimal.mjs files. See: https://github.com/MikeMcl/decimal.js In certain webpack configurations, the decimal.mjs file is loaded, causing the error: ``` Uncaught TypeError: decimal_js__WEBPACK_IMPORTED_MODULE_0__.default.clone is not a function createBigNumberClass BigNumber.js:12 assertAndCreate factory.js:35 ``` When we are more specific with this import, this error is resolved. --- src/type/bignumber/BigNumber.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/type/bignumber/BigNumber.js b/src/type/bignumber/BigNumber.js index 9b424f97ac..1721f033b4 100644 --- a/src/type/bignumber/BigNumber.js +++ b/src/type/bignumber/BigNumber.js @@ -1,4 +1,4 @@ -import Decimal from 'decimal.js' +import Decimal from 'decimal.js/decimal.js' import { factory } from '../../utils/factory.js' const name = 'BigNumber'