fastify-type-provider-zod icon indicating copy to clipboard operation
fastify-type-provider-zod copied to clipboard

Hybrid bundle (ESM, CJS)

Open formatlos opened this issue 1 year ago • 2 comments

As some libraries already moved away from CommonJS and delivering ESM only builds, we startet moving our projects over to using ESM as well.

Now when importing ZOD in our project, we run into the problem, that the ESM build of zod is used while zod loaded through this library will use the CJS build, leading to zod having troubles with some schemas (because it's using instanceof internally).

Moving forward it would be great if you could bundle the lib with both CJS and ESM bundles.

formatlos avatar Oct 22 '24 13:10 formatlos

Sure, that's something that we can do

kibertoad avatar Oct 22 '24 13:10 kibertoad

Should be addressed by

  • https://github.com/turkerdev/fastify-type-provider-zod/pull/153
  • https://github.com/turkerdev/fastify-type-provider-zod/pull/169

Now v5.0.1 exports both CJS and ESM files

marcalexiei avatar Jun 11 '25 03:06 marcalexiei