Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URGENT 3.2.0 is very broken #68

Closed
thanpolas opened this issue Aug 23, 2021 · 8 comments
Closed

URGENT 3.2.0 is very broken #68

thanpolas opened this issue Aug 23, 2021 · 8 comments

Comments

@thanpolas
Copy link

I just upgraded to 3.2.0 and I get JSBI.BigInt is undefined error. Please verify the build.

@HolgerJeromin
Copy link

Probably related to #67
But I think the developers needs more information about your setup. (what prints the error message?)

@thanpolas
Copy link
Author

thanpolas commented Aug 23, 2021

Simple access to JSBI.BigInt() breaks.

Step to reproduce:

npm install jsbi --save

app.js

const JSBI = require('jsbi');
console.log('JSBI.BigInt:', JSBI.BigInt);

@mathiasbynens
Copy link
Member

Yes, this is likely due to #67. I’ll take a look. cc @12wrigja

@mathiasbynens
Copy link
Member

mathiasbynens commented Aug 23, 2021

Workaround for those stuck on v3.2.0:

const JSBI = require('jsbi').default;

But yeah we should try to restore the old behavior of exporting JSBI directly (and not as a named export called default) in the CommonJS bundle.

Update: Fixed in v3.2.1. Please upgrade instead of using this workaround!

mathiasbynens added a commit that referenced this issue Aug 23, 2021
As part of the TypeScript migration in #67 we accidentally made the CommonJS bundle have a `default` export, which wasn’t the case before.

This patch fixes the Rollup configuration to restore the old behavior of `module.export = JSBI`.

Issue: #68, #67
mathiasbynens added a commit that referenced this issue Aug 23, 2021
As part of the TypeScript migration in #67 we accidentally made the CommonJS bundle have a `default` export, which wasn’t the case before.

This patch fixes the Rollup configuration to restore the old behavior of `module.export = JSBI`.

Issue: #68, #67
@thanpolas
Copy link
Author

thank you Mathias ❤️

@mathiasbynens
Copy link
Member

Fixed and released in v3.2.1. Let me know if that helped!

@gitmalong
Copy link

Using v3.2.1 in a Typescript project

  1. Imported with const JSBI = require('jsbi').default;
   TypeError: Cannot read property 'subtract' of undefined

    > 38 |         const amount = JSBI.subtract(

@12wrigja
Copy link
Collaborator

With v3.2.1 I believe Mathias fixed this so the above workaround is no longer necessary, and you should instead be able to write

const JSBI = require('JSBI');

JSBI.substract(...);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants