express-async-handler icon indicating copy to clipboard operation
express-async-handler copied to clipboard

Add @types/express as dependency

Open leafac opened this issue 4 years ago • 2 comments

The types include import express = require('express');, so @types/express should be declared as a dependency in package.json, not as a devDependency. See the TypeScript Handbook for reasoning. I can’t use express-async-handler because of this.

leafac avatar Feb 10 '21 17:02 leafac

You're probably right that it should be under "dependencies".

But I don't understand the part "I can’t use express-async-handler because of this.". We also use this library in a TypeScript project, without a problem. I think if your project itself has the dependency to the @types/express package, it should work fine.

heidemn avatar Aug 18 '21 20:08 heidemn

@heidemn Unfortunately at this point I don’t remember what went wrong. I tried it again and it worked 🤷‍♂️

leafac avatar Aug 27 '21 22:08 leafac