Closed ChaseWagoner closed 4 years ago
Thank you for such detail issue report! We greatly appreciated it and welcome our 1st user! I just added tslib
into our dependency. You can bump the version to 0.2.0 to see if it works.
I've updated to 0.2.0, and the issue seems to be resolved. Thanks @haoliu-amp.
Firstly, thank you for publishing a Node SDK! I greatly appreciate it.
When requiring
@amplitude/node
, I seeError: Cannot find module 'tslib'
.Environment setup:
I did not find any direct references to
tslib
insrc/
, but I did some investigation after cloningAmplitude-Node
:The top-level packages using
tslib
are onlydevDependencies
, sotslib
would not be published with@amplitude/node
. I wondered whytslib
was used by the built package:dist/nodeClient.js
contains the following:I don't know which compiler/tsconfig settings cause
tslib
to be used forextends
in the distributed code, but I have found a workaround: in my project that uses@amplitude/node
, I also installtslib
as a dependency. That resolves the error, at least short-term. Long-term, in@amplitude/node
itself, I don't know if it's the best way to solve the error, but I have found one workable solution: merely addingtslib
todependencies
does seem to fix the issue.