Mini-ghost/vorms

Resolver types are not exported correctly for modern node

smonist opened this issue · 0 comments

Describe the bug

The types of the resolver package are exported in a way that is not compatible with moduleResolution: "Bundler". You can check the compatibility table here.

Detailed error message:

Could not find a declaration file for module '@vorms/resolvers/zod'. '/home/simon/ssp/node_modules/@vorms/resolvers/zod/dist/index.esm.mjs' implicitly has an 'any' type.
  Try `npm i --save-dev @types/vorms__resolvers` if it exists or add a new declaration (.d.ts) file containing `declare module '@vorms/resolvers/zod';`ts(7016)

This can be easily fixed by adding a 'types' field to the exports. I will open a PR in a minute.

Reproduction

https://publint.dev/@vorms/resolvers@1.1.0

Steps to reproduce

  • use a tsconfig with "moduleResolution": "Bundler"
  • import { zodResolver } from '@vorms/resolvers/zod';