I think it's deeply hidden inside: https://www.typescriptlang.org/tsconfig/#esModuleInterop
When you use:
import removeMarkdown from 'markdown-to-text';
The value removeMarkdown is actually { default: [Function: removeMarkdown] } (not matching the types), It's not easy to work around this, because import { default as.... also doesn't work, oddly still getting the value { default: [Function: removeMarkdown] }. I'm using TypeScript 5.0.0.
I'm way out of my depth here, because I though since both my package and yours are both using esModuleInterop: true we'd be home free, but then I did read: microsoft/TypeScript#27293 (comment), which kind of suggests that targeting CJS might be the issue, maybe.
In any event, a huge win might simply be to also export as a named removeMarkdown, so:
import { removeMarkdown } from 'markdown-to-text';
also works. This is not at all uncommon.
I think it's deeply hidden inside: https://www.typescriptlang.org/tsconfig/#esModuleInterop
When you use:
The value
removeMarkdownis actually{ default: [Function: removeMarkdown] }(not matching the types), It's not easy to work around this, becauseimport { default as....also doesn't work, oddly still getting the value{ default: [Function: removeMarkdown] }. I'm using TypeScript 5.0.0.I'm way out of my depth here, because I though since both my package and yours are both using
esModuleInterop: truewe'd be home free, but then I did read: microsoft/TypeScript#27293 (comment), which kind of suggests that targeting CJS might be the issue, maybe.In any event, a huge win might simply be to also export as a named
removeMarkdown, so:also works. This is not at all uncommon.