Closed JimmyBjorklund closed 3 weeks ago
Seems like skipLibCheck is false explicitly? I'm not sure, but the joi part seems more like an issue with hapi's type declarations. Not sure about koa though
Seems like skipLibCheck is false explicitly? I'm not sure, but the joi part seems more like an issue with hapi's type declarations. Not sure about koa though
Confirm:
When I try to reproduce #1594, I create another clean repo using tsoa@6.1.5 locally.
skipLibCheck
is false in default, after I explicitly set it to true,
the joi
import error gone.
Detail tsconfig.json
{
"compilerOptions": {
/* Basic Options */
"incremental": true,
"target": "es6",
"module": "commonjs",
"outDir": "build",
/* Strict Type-Checking Options */
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"alwaysStrict": true,
/* Additional Checks */
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
/* Module Resolution Options */
"moduleResolution": "node",
"baseUrl": ".",
"esModuleInterop": true,
/* Experimental Options */
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
/* Advanced Options */
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true
}
}
@JimmyBjorklund what package manager are you using?
I am having a similar issue with the latest version 6.1.5
backend-1 | ../node_modules/@hapi/hapi/lib/types/route.d.ts(2,68): error TS2307: Cannot find module 'joi' or its corresponding type declarations.
backend-1 | ../node_modules/@hapi/hapi/lib/types/server/server.d.ts(4,22): error TS2307: Cannot find module 'joi' or its corresponding type declarations.
skipLibCheck
is turned off, but it doesn't feel good to me, to turn that on on production level.
Using npm (v10.2.4) on arm64v8/node:20.11.1-alpine3.19 (running on M1 Pro)
@JimmyBjorklund what package manager are you using? npm --version 10.2.3 node --version v20.10.0
I am having a similar issue with the latest version 6.1.5
backend-1 | ../node_modules/@hapi/hapi/lib/types/route.d.ts(2,68): error TS2307: Cannot find module 'joi' or its corresponding type declarations. backend-1 | ../node_modules/@hapi/hapi/lib/types/server/server.d.ts(4,22): error TS2307: Cannot find module 'joi' or its corresponding type declarations.
skipLibCheck
is turned off, but it doesn't feel good to me, to turn that on on production level.Using npm (v10.2.4) on arm64v8/node:20.11.1-alpine3.19 (running on M1 Pro)
You can always add joi to (dev)Deps yourself. That would be a fix we can also to, but it doesn't feel great.
Thanks @JimmyBjorklund for opening an issue over at the hapi repo: https://github.com/hapijs/hapi/issues/4491
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Still an issue
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Still an issue :/
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
If someone has a good way to fix this on our side, I'll reopen. The way I see it, add joi and don't use it, just to satisfy the type checker, declare it as any, or skip checking on it.
The latest version 6.1.4 causes new build issues.
0.932 > tsc 0.932 3.885 node_modules/@hapi/hapi/lib/types/route.d.ts:2:68 - error TS2307: Cannot find module 'joi' or its corresponding type declarations. 3.885 3.885 2 import { ObjectSchema, ValidationOptions, SchemaMap, Schema } from 'joi'; 3.885
~3.885 3.887 node_modules/@hapi/hapi/lib/types/server/server.d.ts:4:22 - error TS2307: Cannot find module 'joi' or its corresponding type declarations. 3.887 3.887 4 import { Root } from 'joi'; 3.887~3.887 3.887 node_modules/@tsoa/runtime/dist/routeGeneration/templates/koa/koaTemplateService.d.ts:1:36 - error TS7016: Could not find a declaration file for module 'koa'. '/usr/src/app/node_modules/koa/lib/application.js' implicitly has an 'any' type. 3.887 Trynpm i --save-dev @types/koa
if it exists or add a new declaration (.d.ts) file containingdeclare module 'koa';
3.887 3.887 1 import type { Context, Next } from 'koa'; 3.887~