The reason why this is happening is because of the introduction of importHelpers as part of the commit #746. As per the documentation at https://www.npmjs.com/package/tslib, it stated that:
This is a runtime library for TypeScript that contains all of the TypeScript helper functions.
This library is primarily used by the --importHelpers flag in TypeScript
Possible Solution
Either:
Add tslib as part of the dependencies of the package when using importHelpers.
Remove importHelpers from tsconfig.json file or set it to false
Steps to Reproduce (for bugs)
Create a very simple project and install the libraries as such
npm i @vonage/server-sdk
npm i -D @types/node typescript
Create a tsconfig.json file with the following contents
Create a very simple typescript file, eg. src/test.ts
import { Vonage } from '@vonage/server-sdk';
const client = new Vonage({
apiKey: "junk",
apiSecret: "junk",
} as any);
Compile it to js by running npx tsc
Run the file using node dist/test.js to see the error
Context
We needed to install tslib as part of our package when it should actually be as part of the dependencies from @vonage/server-sdk. Service fails to startup otherwise.
Expected Behavior
Able to start up a service using
@vonage/server-sdk
without any issueCurrent Behavior
When using typescript with
@vonage/server-sdk
and without the presence oftslib
, the following error is being encountered:The reason why this is happening is because of the introduction of
importHelpers
as part of the commit #746. As per the documentation at https://www.npmjs.com/package/tslib, it stated that:Possible Solution
Either:
tslib
as part of thedependencies
of the package when usingimportHelpers
.importHelpers
fromtsconfig.json
file or set it tofalse
Steps to Reproduce (for bugs)
tsconfig.json
file with the following contentsCreate a very simple typescript file, eg.
src/test.ts
npx tsc
node dist/test.js
to see the errorContext
We needed to install
tslib
as part of our package when it should actually be as part of the dependencies from@vonage/server-sdk
. Service fails to startup otherwise.Your Environment