JonathanWilbur / asn1-ts

ASN.1 TypeScript library, including codecs for Basic Encoding Rules (BER) and Distinguished Encoding Rules (DER).
MIT License
32 stars 6 forks source link

Missing tslib dependency #19

Closed kazkansouh closed 1 year ago

kazkansouh commented 2 years ago

Hello, thanks for making a nice project!

I noticed that after importing this project and compiling my (TypeScript) code into a common js module it was failing to run due to a missing dependency tslib.

Uncaught Error: Cannot find module 'tslib'
Require stack:
- /dev/shm/t/node_modules/asn1-ts/dist/node/index.js

I believe the issue is related to:

https://github.com/JonathanWilbur/asn1-ts/blob/951e31b76e6a6adbbd997f73a7aebba0c1c1fd9b/tsconfig.json#L19

From the TypeScript documenation:

If the importHelpers flag is on, these helper functions are instead imported from the tslib module. You will need to ensure that the tslib module is able to be imported at runtime. This only affects modules; global script files will not attempt to import modules.

I believe you need to do a simple npm i tslib?

JonathanWilbur commented 1 year ago

You're right! My apologies. Fixing now.

JonathanWilbur commented 1 year ago

Fixed with version 7.0.17.