feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
14.98k stars 743 forks source link

migration to v5 breaks TS on express methods #3238

Closed dominikabieder closed 1 year ago

dominikabieder commented 1 year ago

since upgrading to v5, the app doesn't start due to typescript errors on all express methods:

They all have a variation of the following error: image

here's my ts config

{
  "compilerOptions": {
    "target": "es2020",
    "module": "commonjs",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true,
    "outDir": "./dist",
    "allowJs": true,
    "resolveJsonModule": true,
    "allowSyntheticDefaultImports": true,
  },
  "include": ["./src/**/*"],
  "exclude": ["e2e-tests", "./src/**/*.test.ts"]
}

Using

   "node": ">= 18.13.0 <19.0.0",
    "yarn": ">= 1.22.11"

I have also created a new feathers project from scratch and the "allowSyntheticDefaultImports" isn't enabled, it's commented out. Tried that but it fix the problem either.

Not sure what else I can do to fix the issue. Any ideas?

dominikabieder commented 1 year ago

turns out they should be extracted from the import like so import express, { json, urlencoded, rest, serveStatic, notFound,errorHandler } from '@feathersjs/express';