question: Class Validator throws ',' expected when I run "tsc"
See original GitHub issueDescription
I’m using TypeORM and Class Validator together. I need to deploy my app to heroku now, so I created a script called “npm build”, which runs the command “tsc”. However, it shows these errors which made my app unable to deploy. Below are the errors:
Minimal code-snippet showcasing the problem
node_modules/class-validator/types/decorator/common/IsIn.d.ts:6:71 - error TS1005: ',' expected.
6 export declare function isIn(value: unknown, possibleValues: readonly unknown[]): boolean;
~~~~~~~
node_modules/class-validator/types/decorator/common/IsIn.d.ts:6:78 - error TS1005: ',' expected.
6 export declare function isIn(value: unknown, possibleValues: readonly unknown[]): boolean;
~
node_modules/class-validator/types/decorator/common/IsIn.d.ts:10:47 - error TS1005: ',' expected.
10 export declare function IsIn(values: readonly any[], validationOptions?: ValidationOptions): PropertyDecorator;
~~~
node_modules/class-validator/types/decorator/common/IsIn.d.ts:10:50 - error TS1005: ',' expected.
10 export declare function IsIn(values: readonly any[], validationOptions?: ValidationOptions): PropertyDecorator;
~
node_modules/class-validator/types/decorator/common/IsNotIn.d.ts:6:74 - error TS1005: ',' expected.
6 export declare function isNotIn(value: unknown, possibleValues: readonly unknown[]): boolean;
~~~~~~~
node_modules/class-validator/types/decorator/common/IsNotIn.d.ts:6:81 - error TS1005: ',' expected.
6 export declare function isNotIn(value: unknown, possibleValues: readonly unknown[]): boolean;
~
node_modules/class-validator/types/decorator/common/IsNotIn.d.ts:10:50 - error TS1005: ',' expected.
10 export declare function IsNotIn(values: readonly any[], validationOptions?: ValidationOptions): PropertyDecorator;
~~~
node_modules/class-validator/types/decorator/common/IsNotIn.d.ts:10:53 - error TS1005: ',' expected.
10 export declare function IsNotIn(values: readonly any[], validationOptions?: ValidationOptions): PropertyDecorator;
~
Found 8 errors.
Expected behavior
I’ve tried uninstalling and reinstalling class validator, but in vain. I expect it to have zero errors and my app successfully deployed to heroku.
Actual behavior
What happens is that the errors above are thrown, making me unable to deploy my application.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Nest class-validator minDate throws error even when the date ...
The problem: If I remove the minDate decorator, everything works fine but I would rather validate this common case. info: typescript: ~4.1.4.
Read more >Getting started with continuous integration for Nest.js APIs
Learn how to build RESTful APIs with Nest.js, a Node.js framework built with TypeScript, and automate testing using CircleCI.
Read more >How to use the class-validator.validateOrReject function in ...
To help you get started, we've selected a few class-validator. ... newProps.birthdate await validateOrReject(validation) } catch (error) { throw new this.
Read more >Dynamic type validation in TypeScript - LogRocket Blog
The most basic validation, it's a set of conditions that check whether the structure is the expected one. const validate = (data: ...
Read more >Documentation - The Basics - TypeScript
The alternative is to use a static type system to make predictions about what code is expected before it runs. Static type-checking. Think...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I am almost 100% sure this is some problem with your build setup. Please provide a minimal, reproducible example otherwise I can guess only.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.