fastify/fastify-websocket

TypeScript error "All declarations of 'RouteOptions' must have identical type parameters"

WesSouza opened this issue · 1 comments

Prerequisites

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

Fastify version

4.9.1

Plugin version

7.1.0

Node.js version

16.17.1

Operating system

macOS

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

12

Description

Installing version 7.1.0 produces a TypeScript error regarding RouteOptions.

Version 7.0.1 does not have this error.

Steps to Reproduce

Install @fastify/websocket version 7.1.0 and fastify 4.9.1 on a project that uses TypeScript, and run tsc to compile the project.

This error appears:

$ tsc
../node_modules/@fastify/websocket/index.d.ts:51:13 - error TS2428: All declarations of 'RouteOptions' must have identical type parameters.

51   interface RouteOptions<
               ~~~~~~~~~~~~

../node_modules/fastify/types/route.d.ts:121:18 - error TS2428: All declarations of 'RouteOptions' must have identical type parameters.

121 export interface RouteOptions<
                     ~~~~~~~~~~~~


Found 2 errors in 2 files.

Errors  Files
     1  ../node_modules/@fastify/websocket/index.d.ts:51
     1  ../node_modules/fastify/types/route.d.ts:121
error Command failed with exit code 2.

Expected Behavior

No response

This should be fixed in Fastify v4.9.2. Sorry for the unwanted breakage.