-
Notifications
You must be signed in to change notification settings - Fork 25
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
TypeError: "class constructors must be invoked with 'new'" #54
Comments
I have a similar problem. Is there any workaround? |
I have the same problem in Angular |
I wonder if it only works with typescript. |
@kud @ManuelCalvo @mkamensky Because Coloquent classes are compiled to ES6 classes, if you extend them in code that is compiled to ES5 you get this problem. Could it be that your projects are compiled to ES5? |
That's right! |
Maybe changing the compile target of this library to es5 would solve the problem, but I'm not sure if it's possible since the library relies on others extending its classes, for one. Would anyone care to try? |
I was using vue's typescript config and failed (didn't try again tho). // tsconfig.json
{
"compilerOptions": {
"target": "es5",
"strict": true,
"module": "es2015",
"moduleResolution": "node"
}
} |
Hello,
I'm doing this:
And I get this error:
TypeError: "class constructors must be invoked with 'new'"
Is it normal?
The text was updated successfully, but these errors were encountered: