Build failed because of no export of ParsedQs from express-serve-static-core

Viewed 1687

I was faced with an error of [@types/express]-Type 'P' is not assignable to type 'ParamsArray', the error was resolved by installing these specific packages "@types/express": "^4.17.8", "@types/express-serve-static-core": "^4.17.13" which throw a new error below. I have tried to downgrade "@types/express-serve-static-core" to "^4.17.5" and install qs, but none of these work.

Any suggestions on how to fix this error?

node_modules/@types/express-serve-static-core/index.d.ts:30:10 - error TS2305: Module '"../qs"' has no exported member 'ParsedQs'.

30 import { ParsedQs } from "qs";

1 Answers

It seems to be a known problem with that package (see this issue). I don't think an update for that has been released yet, but in the meantime you can use --skipLibCheck to prevent tsc from looking into packages that deeply and finding that error. This thread explains what that flag does nicely.

Related