Closed SkullCutter02 closed 3 years ago
You should not compile your node_modules
. Add it to the exclude list in your tsconfig.json
.
You should not compile your
node_modules
. Add it to the exclude list in yourtsconfig.json
.
Just added "exclude": ["node_modules"]
to tsconfig.json, still same problem.
I'd also like to add that if I just run tsc
in my terminal, these errors will not log. However, if I did npm run build
which executes the command tsc
, then it will throw these errors. Very weird
I am almost 100% sure this is some problem with your build setup. Please provide a minimal, reproducible example otherwise I can guess only.
K sorry for the late reply. I got a reproducible example that can be set up easily.
First do npx typeorm init
to initialise the project. Update the dependency version with npm install
, then install class-validator by doing: npm i class-validator
. When the project is initialised, it should have created an entity called User. Add a @MinLength decorator to one of the columns in the user entity.
Afterwards, in package.json, create a script called build: "build": "tsc"
. Now run npm run build
, and the errors will be produced.
What typescript version do you use? I think you need version ^3.1.3
. Maybe try tsc -v
command.
What typescript version do you use? I think you need version
^3.1.3
. Maybe trytsc -v
command.
It's version 4.1.3
I cannot reproduce. After following the provided steps the starter successfully builds for me. It's some problem with your setup.
Dear @NoNameProvided I'm currently working on a framework based on Angular 7 with TypeScript 3.2.4 and I encountered the same issue š
To understand what's is going on, I created the following project https://github.com/SuperITMan/class-validator-ts-issue with a basic example in ng7, ng8 and ng9. ng7 and ng8 do not compile by running npm run tsc
, you can find all the information in the README file š
Could you reopen this issue and investigate it ? I have the feeling it might be related to TypeScript version...
Thanks for your great library! Regards, Alexis
Hello @SkullCutter02 @SuperITMan, I had the same issue, fixed it by using Typescript v4.0.5 and adding --skipLibCheck or setting skipLibCheck to true in tsconfig.json
Hope this can help you
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.
Description
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
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.