Error importing fraction.js/bigint
Hello,
I'm having the following error when compiling TS:
Module not found: Error: Package path ./bigfraction is not exported from package /home/runner/work/project/node_modules/fraction.js (see exports field in /home/runner/work/project/node_modules/fraction.js/package.json)
The import statement that's failing is this:
import Fraction from 'fraction.js/bigfraction';
Is this no longer supported? If not, how can I import the big fraction version?
I think you have to enter the full path. Did it work with the statement you wrote previously?
Just to let you know, there will soon be Fraction.js v5 which will be based on BigInt. The current change to make Fraction.js an ESM module was the first step to modernize the package.
I think you have to enter the full path. Did it work with the statement you wrote previously?
Assuming the full path is fraction.js/bigfraction, no, the import statement I pasted here didn't work, and it failed with the following error:
Module not found: Error: Package path ./bigfraction is not exported from package /Users/pedroteixeira/projects/project/node_modules/fraction.js (see exports field in /Users/pedroteixeira/projects/project/node_modules/fraction.js/package.json)
bigfraction.js was just shipped experimentally, as I said it will become soon v5. If you want to use it now, you can import it with
import Fraction from './node_modules/fraction.js/bigfraction.js';
@infusion thanks, but I still get the same error. I think we'll wait for version 5. Thanks!
Until that you can just copy over the bigfraction.js file into your project.