paulmillr / noble-curves

Audited & minimal JS implementation of elliptic curve cryptography.
https://paulmillr.com/noble
MIT License
621 stars 56 forks source link

Unable to import BLS12-381 #89

Closed petscheit closed 9 months ago

petscheit commented 9 months ago

I'm currently trying to add the BLS curve to a typescript project I have, and am unable to compile once I import via:

import { bls12_381 as bls } from '@noble/curves/bls12-381';

here a portion of the errors, this is the first one (there are loads more, but all in the same file):

node_modules/@noble/curves/abstract/bls.d.ts:80:64 - error TS1005: '>' expected.

80     G1: CurvePointsRes<Fp> & ReturnType<typeof htf.createHasher<Fp>>;

First I thought this could be a ESM/CJS issue, but I'm reasonably sure it is not at this point. I tried importing in different modes and the outcome is always the same. I tried importing the other curves, and have no issues there at all.

Can someone reproduce this?

paulmillr commented 9 months ago

you're probably using old version of typescript

petscheit commented 9 months ago

Ah man, indeed, updating to latest fixes this.

Thanks for the quick support and the sick library.