Closed juanAngel closed 2 years ago
Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.
I have done tests, and it seems that npm downloads 2 versions of ajv in my repository, v6 in an external directory. and v8 in the subdirectory of your project. To solve the problem I had to add ajv:8 as a dependency to the package.json to force that version to always be used
Prerequisites
Fastify version
4.7.0
Plugin version
3.3.1
Node.js version
v16.14.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
fedora 35
Description
when compiling a typescript project that depends on "ajv-compiler" It stops because of an error in the type definitions
I am using @fastify/accepts-serializer:5.1.0
the error refers to this line https://github.com/fastify/ajv-compiler/blob/9fcbe6f85a463b014da7f581dfb5417ef3bf61fe/index.d.ts#L33 And it seems to be fixed if you change it to this
export type Ajv = _ajv.Ajv;
Steps to Reproduce
npm run build
Expected Behavior
No response