You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see you're using old plain tsc for compile. I suggest to rework the project build setup to use tsup and emit modern CJS and ESM builds (and update package.json accordingly). I can come up with a PR if that's something that you will possibly accept.
The text was updated successfully, but these errors were encountered:
It's ugly, but I've worked around this in my own code with this wrapper:
importadvisoryLockfrom'advisory-lock'typeAdvisoryLock=typeofadvisoryLocklet_advisoryLock=advisoryLockasany// See https://github.com/olalonde/advisory-lock/issues/1 for why we need thisif(_advisoryLock.default){_advisoryLock=_advisoryLock.default}exportdefault_advisoryLockasAdvisoryLock
With Typescript or native ESM, the module doesn't import correctly:
Run it with
tsx
(same will happen withvite
and probably most other bundlers):or just run as an ESM script in a project with
{ "type": "module" }
inpackage.json
:This is because the imported module, despite being typed as a function, is in fact an object:
I see you're using old plain
tsc
for compile. I suggest to rework the project build setup to use tsup and emit modern CJS and ESM builds (and updatepackage.json
accordingly). I can come up with a PR if that's something that you will possibly accept.The text was updated successfully, but these errors were encountered: