Open steelbrain opened 1 month ago
Hello!
Thanks for making this package! It seems that typings are broken when tsconfig sets module resolution to bundler. Here's a repository with a reproduction: https://github.com/steelbrain/bug-reproduction-2024-10-redlock
Here's the error message
There are types at 'bug-reproduction-2024-10-redlock/node_modules/redlock/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The 'redlock' library may need to update its package.json or typings.
Ah. It seems to be fixed in the repository but not released. https://github.com/mike-marcacci/node-redlock/commit/06d9f5cae1439696467008ebe98a705e6ba9821e
Anyone know a workaround for this?
I use pnpm, which allows you to patch. So I just patched the package.json file to update the exports like this:
pnpm
package.json
exports
"exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/esm/index.js", "require": "./dist/cjs/index.js" } }
Hello!
Thanks for making this package! It seems that typings are broken when tsconfig sets module resolution to bundler. Here's a repository with a reproduction: https://github.com/steelbrain/bug-reproduction-2024-10-redlock
Here's the error message