misode.github.io icon indicating copy to clipboard operation
misode.github.io copied to clipboard

RangeError: Something went wrong rendering the generator: The number Infinity cannot be converted to a BigInt because it is not an integer

Open AjaxGb opened this issue 2 years ago • 0 comments

Go to https://misode.github.io/loot-table/, add a function, and set the count field to Infinity. The website fails with an exception:

RangeError: Something went wrong rendering the generator: The number Infinity cannot be converted to a BigInt because it is not an integer
    at BigInt (<anonymous>)
    at dn.nextInt (../../node_modules/deepslate/lib/math/random/LegacyRandom.js:41:26)
    at nextInt (src/app/previews/LootTable.ts:63:32)
    at result (src/app/previews/LootTable.ts:50:14)
    at generateLootTable (src/app/components/previews/LootTablePreview.tsx:27:16)
    at xc (../../node_modules/preact/hooks/dist/hooks.module.js:1:2451)
    at Array.forEach (<anonymous>)
    at bm (../../node_modules/preact/hooks/dist/hooks.module.js:1:1395)

You also get weird behavior when setting it to -Infinity (the output is rendered as "count": null), but no immediate crash.

AjaxGb avatar Oct 13 '22 17:10 AjaxGb