Skip to content

Incompatibility with fastify@5.4.0 #76

@jsynowiec

Description

@jsynowiec

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

5.4.0

Plugin version

0.9.1

Node.js version

v22.15

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

15.5

Description

The following code for manually registering the plugin works fine with fastify@5.3.3.

  const fastifyOtelInstrumentation = new FastifyOtelInstrumentation({
    servername: pkg.name,
  });

  const fastifyAdapter = new FastifyAdapter();
  await fastifyAdapter
    .getInstance()
    .register(fastifyOtelInstrumentation.plugin());

  const app = await NestFactory.create<NestFastifyApplication>(AppModule, fastifyAdapter);

However, after upgrading to 5.4.0, TypeScripts raises the following error: error TS2769: No overload matches this call. Digging into the error message, I was able to identify that the problem is a type incompatibility between FastifyTypeProvider and FastifyTypeProviderDefault in the FastifyInstance type.

Additionally, the FastifyOtelOptions (interface) is different from FastifyPluginOptions (type alias), but it doesn't seem to be related.

Link to code that reproduces the bug

https://gist.github.com/jsynowiec/047a80571fcf62602beeb6e86df99ea5

Expected Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions