-
-
Notifications
You must be signed in to change notification settings - Fork 524
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
Class constructor UserDto cannot be invoked without 'new' #411
Comments
It seems to be a TypeScript issue. Make sure the target in your tsconfig.json is es6 or higher |
@tolstenko Did you resolve this issue? |
@tolstenko @douglance did you resolve this question? [2] |
adding // src/common/abstract.entity.ts
@Exclude()
abstract dtoClass: new (entity: AbstractEntity, options?: any) => T |
I'm using the updated version of awesome boilerplate. It's incredible :D I'm facing a similar issue :S using the abstract entities and abstract dtos. Even updating the The update code should be similar to this:
I've tried to break the solution in typeorm save method which is not the best solution, but still got the same error :S The code should look like this.
The error is: "EntityColumnNotFound: No entity column "dtoClass" was found." |
First of all, this lib is awesome!
I am facing the same problem of #378
Class constructor UserDto cannot be invoked without 'new'
TypeError: Class constructor UserDto cannot be invoked without 'new'
I modified the boilerplate https://github.com/NarHakobyan/awesome-nest-boilerplate adding the crud controller and crud service.
The main differences between your example and the implementation are:
I use an AbstractDto with a constructor that receives an AbstractEntity.
Here is the AbstractDto:
AbstractEntity:
And on top of that I create my dtos and entities:
UserDto
UserEntity
I found some descriptions indicating that I need to change the tsconfig.json target to at least ES6, but it is already there.
My option is to not use a dtos with constructors, right? Will I need to create another dto just for this scenario like the other dto but without constructor? Or could you provide an example using dtos with constructors?
Thanks in advance
The text was updated successfully, but these errors were encountered: