colyseus / uWebSockets-express

Express API compatibility layer for uWebSockets.js
https://npmjs.com/package/uwebsockets-express
MIT License
56 stars 13 forks source link

Property 'socket' in type 'IncomingMessage' is not assignable to the same property in base type 'IncomingMessage' #16

Closed CookedApps closed 2 years ago

CookedApps commented 2 years ago

Trying to build my application after adding this library results in a compiler error.

Running npm run build results in an error:

> tsc

node_modules/uwebsockets-express/lib/IncomingMessage.d.ts:25:5 - error TS2416: Property 'socket' in type 'IncomingMessage' is not assignable to the same property in base type 'IncomingMessage'.
  Type 'Socket' is missing the following properties from type 'Socket': write, connect, setEncoding, pause, and 43 more.

25     socket: Socket;
       ~~~~~~

Found 1 error in node_modules/uwebsockets-express/lib/IncomingMessage.d.ts:25

Dependency versions:

tsconfig:

I am not sure if this is relevant but it might be.

{
  "compilerOptions": {
    "outDir": "./dist",
    "rootDir": "src/",
    "target": "ES6",
    "module": "CommonJS",
    "moduleResolution": "Node",
    "strict": true,
    "strictNullChecks": false,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "removeComments": true,
    "resolveJsonModule": true,
  },
  "exclude": ["node_modules"],
  "include": ["./src/**/*.tsx", "./src/**/*.ts"]
}

Running my application with ts-node works fine, just compiling it fails. Maybe I'm missing something out. :)

Thank you for this awesome library. It really saves time!

endel commented 2 years ago

Hey @CookedApps, please try adding skipLibCheck: true to your tsconfig.json file, like this 🙏 https://github.com/colyseus/create-colyseus-app/blob/f49f886288f398276413b779cbe5c27615706deb/tsconfig.json#L11

CookedApps commented 2 years ago

@endel Thank you for the quick response. That helped! :partying_face: