-
Notifications
You must be signed in to change notification settings - Fork 36
Conversation
hey, thanks for opening this issue. I believe since we use @types/bn.js for the types in Node.js it works without needing the i wonder if we would need to move these types to I haven't used Deno yet but would like to learn or investigate more. could you try adding |
@ryanio importing bn.js works flawlessly import BN from 'https://esm.sh/bn.js'
console.log(BN) I'm not sure if I was clear but the reason why this error appears is not because of import type { BN } from 'bn.js' or this: import BN = require('bn.js')
type BNType = typeof BN btw why the source mixed imports and requires? TypeScript will transpile imports to CJS automatically so you can safely use ES6 imports: import BN from 'bn.js' |
is there any type information available though? as far as I know bn.js doesn't have any type definition files, which is why we use
I believe we use I wonder if updating to |
@ryanio sorry I forgot to tell, esm.sh is a CDN for Deno and it automatically maps regarding "TypeScript complains", I think there's a setting to disable erroring on modules without typings, see "skipLibCheck" |
is there anything preventing this from being merged? |
I updated it to be the same as in the util package, please take a look @ryanio |
@talentlessguy thanks! and this change made it start working in Deno for you? |
@ryanio looks like tsconfig is wrongly configured? |
also I cannot test this in Deno since it's not published as an npm package |
ah yes I just checked and the Can you add the We have considered bringing this lib into the monorepo but it doesn't receive much updates so that's why we haven't for now. |
@ryanio done |
@talentlessguy |
@ryanio and it builds fine |
looks like it's getting stuck on karma now, can you try adding regarding trying it in deno, maybe https://gitpkg.vercel.app/ could help? |
@ryanio Karma seems to be broken completely and not sure if it's my fault, looks like it was broken before me
|
@ryanio gitpkg is for npm, not for Deno and Deno doesn't support importing from github files either if they have relative dependencies (such as |
@ryanio is there anything else needs to be fixed for this to get merged? |
@ryanio ping plzzzz merge it's a big blocker for deno :(( |
@talentlessguy sorry for the delay, we are focusing on the merge work in our monorepo this upcoming week but we will try to get to it after - do you need a npm release or is just merging to master is fine for your needs? because I could do that more immediately. (cc @holgerd77) can you also update from require to import BN in thanks! |
@ryanio ok I will, one sec |
@ryanio done |
@talentlessguy thanks! could you clarify if you need this released on npm or would merge to master be suitable for now |
@ryanio it has to be released on npm beause esm.sh transforms npm packages |
@ryanio ping please release the package ...... |
our team is juggling a lot right now we will try to get to it soon! also the ci is failing on lint, could you run lint:fix? |
@ryanio done |
🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
@ryanio omg thanks for merging! could you release a patch version now |
yes will do now :) |
@talentlessguy have published v2.2.7 on npm, thanks for your continued patience and follow up :) |
@ryanio omg omg thanks one more thing could you please bump rlp version on ethereumjs-util? |
@talentlessguy since this was a patch release and it is specified in ethereumjs-util with a carat it should automatically pick it up on new install |
At the moment, this module fails to import in Deno because of a type error:
this PR adds a
typeof
keyword, so this works on both Node.js and Deno