Open kasbah opened 1 year ago
It may be related to https://stackoverflow.com/questions/63189533/how-can-i-solve-error-this-expression-is-not-constructable and the hint from TS docs:
Note that ES6 modules cannot directly export class objects.
A sort of workaround is to set target to ES5 in compiler options.
...
"compilerOptions": {
"noEmitOnError": false,
"target": "ES5",
...
This does give a compilation error
node_modules/await-lock/build/AwaitLock.d.ts:5:5 - error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher.
5 #private;
~~~~~~~~
But the emitted code actually works.
This is similar to #5 but I'm not using
require
but Typescript withmoduleResolution: "node"
. https://github.com/kasbah/await-lock-bug-repro