express-async-handler
express-async-handler copied to clipboard
Add @types/express as dependency
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.
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 Unfortunately at this point I don’t remember what went wrong. I tried it again and it worked 🤷♂️