ljlm0402 / typescript-express-starter

📘 Quick and Easy TypeScript Express Starter
http://npm.im/typescript-express-starter
MIT License
2.72k stars 419 forks source link

Linting-Error(Outdated Package?): Module '"class-transformer"' has no exported member 'plainToClass'.ts, Ln1:Validation.middleware.ts #125

Closed AbhinavRobinson closed 2 years ago

AbhinavRobinson commented 2 years ago

Describe the Bug (버그 설명)

Module '"class-transformer"' has no exported member 'plainToClass'.ts(2305)

Version to Reproduce (현재 사용한 버전)

Latest from npx (as of 25th Nov, 2021)

Steps to Reproduce (재현 순서)

  1. Go to Validation.middleware.ts
  2. See error, no exported member plainToClass, Line 1

Expected Behavior (예상 동작)

No such linting error should be present

Actual Behavior (실제 동작)

Linting error from typescript, no such exported module plainToClass from class-transformer

Additional Context (추가 사항)

N/A

Capture screen (캡쳐 화면)

Screenshot 2021-11-25 at 12 44 21 PM
ljlm0402 commented 2 years ago

@AbhinavRobinson

Check the version of the library to see if "plane To Class" exists or not, and if you don't, you can lower the library version and use it.

"class-transformer": "^0.4.0",

image

Also, by checking the class-transformer README, you can confirm that the method exists. Note please.

https://github.com/typestack/class-transformer#plaintoclass

lindesvard commented 2 years ago

Got this myself. Seems like they have removed it in 0.4.1 which we get since ^.

Forcing it to get 0.4.0 solves the issue.

edit: They renamed it to plainToInstance for what I can tell https://github.com/typestack/class-transformer/pull/992/files#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80