Closed telmotrooper closed 5 years ago
Thanks for the PR, I'm also on typescript 3.1.6 and I'm actually not able to use import asyncHandler from 'express-async-handler'
. Perhaps a setting in your tsconfig
is preventing you from using import * as asyncHandler from 'express-async-handler'
?
I believe you need the allowSyntheticDefaultImports
or esModuleInterop
flags to be set to true
in the tsconfig.json
file to support the following syntax:
import asyncHandler from 'express-async-handler'
Otherwise, you have to use this:
import * as asyncHandler from 'express-async-handler'
Thanks!
I'm pretty sure somewhere along the way you guys changed how the middleware is exported and your old TypeScript import syntax no longer works. I updated the README file with the import that works with the current version (as that is what has worked in my current project).
It might be a relevant that I'm on (current) TypeScript 3.1.6.