Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The latest version 6.1.4 causes new build issues. #1590

Open
JimmyBjorklund opened this issue Mar 15, 2024 · 12 comments
Open

The latest version 6.1.4 causes new build issues. #1590

JimmyBjorklund opened this issue Mar 15, 2024 · 12 comments

Comments

@JimmyBjorklund
Copy link

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 Try npm i --save-dev @types/koa if it exists or add a new declaration (.d.ts) file containing declare module 'koa';
3.887
3.887 1 import type { Context, Next } from 'koa';
3.887 ~~~~~

@WoH
Copy link
Collaborator

WoH commented Mar 15, 2024

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

@WoH
Copy link
Collaborator

WoH commented Mar 15, 2024

935af8e will fix koa.

@jackey8616
Copy link
Collaborator

jackey8616 commented Mar 18, 2024

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 [email protected] 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
  }
}

@WoH
Copy link
Collaborator

WoH commented Mar 18, 2024

@JimmyBjorklund what package manager are you using?

@lgoeckener
Copy link

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
Copy link
Author

@JimmyBjorklund what package manager are you using?
npm --version
10.2.3
node --version
v20.10.0

@WoH
Copy link
Collaborator

WoH commented Mar 18, 2024

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.

@WoH
Copy link
Collaborator

WoH commented Mar 18, 2024

Thanks @JimmyBjorklund for opening an issue over at the hapi repo: hapijs/hapi#4491

Copy link

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

@github-actions github-actions bot added the Stale label Apr 18, 2024
@JimmyBjorklund
Copy link
Author

Still an issue

@github-actions github-actions bot removed the Stale label Apr 19, 2024
Copy link

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

@github-actions github-actions bot added the Stale label May 19, 2024
@ClementValot
Copy link

Still an issue :/

@github-actions github-actions bot removed the Stale label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants