koa-helmet
koa-helmet copied to clipboard
New TS types fail to import koa
Thanks for merging types directly into the lib.
My dependency bot is trying to pull this update, but my tsc builds with yarn 2.4.1 (with pnp) fail on it for some reason.
> tsc -b tsconfig.build.json
.yarn/cache/koa-helmet-npm-6.1.0-5168096bc9-63a0ab6ded.zip/node_modules/koa-helmet/koa-helmet.d.ts:9:37 - error TS2307: Cannot find module 'koa' or its corresponding type declarations.
To be honest, I'm kinda stumped, the source looks just fine.
Node 14.16.0 x64 on windows 10
tsconfig,json (definitely irrelevant stuff omitted)
{
"compilerOptions": {
"composite": true,
"esModuleInterop": true,
"importHelpers": true,
"module": "commonjs",
"noUncheckedIndexedAccess": true,
"strict": true,
"target": "es2020"
}
}
package.json (also trimmed down)
"dependencies": {
"koa": "2.13.1",
"koa-compose": "4.1.0",
"koa-compress": "5.0.1",
"koa-helmet": "6.1.0",
"koa-router": "10.0.0",
},
"devDependencies": {
"@types/koa": "2.13.1",
"@types/koa-compose": "3.2.5",
"@types/koa-compress": "4.0.1",
"@types/koa-router": "7.4.1",
"tslib": "2.1.0",
"typescript": "4.2.3"
}
I can send you a copy of my whole (tiny) project if you can't troubleshoot it with this.