samchon / nestia

NestJS Helper Libraries + TypeScript OpenAPI generator
https://nestia.io/
MIT License
1.83k stars 94 forks source link

nestia sdk fails with tsconfig's Lib #996

Open sacru2red opened 2 months ago

sacru2red commented 2 months ago

Bug Report

I found case that no matter what value I put in the Lib value in tsconfig.json, the sdk build fails. (If the Lib value is left blank, the build succeeds.)

Do you know why or how to fix it?

https://github.com/sacru2red/nestia-error-with-tsconfig-lib

sacru2red commented 2 months ago

I dont know why it fails on lib is empty array ("lib": [])

image

sacru2red commented 2 months ago

I temporarily deleted the "lib". And added the "types" property.

"types": [
      "jest",
      "node",
      "multer",
      "typescript/lib/lib.es2023.d.ts"
    ],

-> fails

samchon commented 2 months ago

It is because if you clear the lib property, you can get the File instance type.

Just fill like below, then no problem.

{
  "lib": ["DOM", "ES2015"]
}
samchon commented 2 months ago

By the way, LTS @types/node version has started declaring the File class type by itself.

I should make it work without the DOM lib configuration in typia.

sacru2red commented 2 months ago

저는 제대로 이해를 못한 것 같아요.

1) "lib": ["DOM", "ES2015"]가 필요하다면 setup 문서에서 설명이 있어야 할 것 같고, 2) 말씀하신대로 구성없이 성공하도록 수정을 하는 것도 방법일 것 같습니다.

1번의 방법은 조금 이상하다고 생각하는게 지금 제가 보고있는데 tsconfig.json인데 이건 nestjs 프로젝트에 대한 설정이잖아요? DOM API를 안쓰는데, DOM을 쓰면 뭔가 이상하지 않나요..