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
What environment are you running in? I don't have a reason to think that CommonJS modules are broken inside apps that use "type": "module". Node.js documentation just says:
Node.js will treat as CommonJS all other forms of input, such as .js files where the nearest parent package.json file contains no top-level "type" field
Perhaps you can use a workaround like this:
import BTree_ from 'sorted-btree';
const BTree = (BTree_ as any).default as typeof BTree_;
Thank you, incredibly fast lib.
Without esm build i.e.
its impossible to use this library if
"type": "module",
is set in package.json.i.e having commonjs I need add
.default
and this breaks typingsTo have near zero setup of esm+commonjs support I can recoomend https://github.com/developit/microbundle
The text was updated successfully, but these errors were encountered: