Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript typings dont work with bundler moduleResolution #307

Open
steelbrain opened this issue Oct 1, 2024 · 3 comments
Open

Typescript typings dont work with bundler moduleResolution #307

steelbrain opened this issue Oct 1, 2024 · 3 comments

Comments

@steelbrain
Copy link

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.

@steelbrain
Copy link
Author

Ah. It seems to be fixed in the repository but not released. 06d9f5c

@ethos-seth
Copy link

Anyone know a workaround for this?

@rdadoune
Copy link

rdadoune commented Nov 8, 2024

I use pnpm, which allows you to patch. So I just patched the package.json file to update the exports like this:

"exports": {
   ".": {
     "types": "./dist/index.d.ts",
     "import": "./dist/esm/index.js",
     "require": "./dist/cjs/index.js"
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants