close

[Fixed] Javascript ES6 TypeError: Class constructor Client cannot be invoked without ‘new’

Today We are Going To Solve Javascript ES6 TypeError: Class constructor Client cannot be invoked without ‘new’ in Javascript. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix Javascript ES6 TypeError: Class constructor Client cannot be invoked without ‘new’ Error?

  1. How to Fix Javascript ES6 TypeError: Class constructor Client cannot be invoked without 'new' Error?

    To Fix Javascript ES6 TypeError: Class constructor Client cannot be invoked without 'new' Error just Edit the Typescript compiler config file. Just edit the Typescript compiler config file, tsconfig.json, to generate ES2017 Javascript code. This will help you to solve this error. { "compilerOptions": { "target": "ES2017",

  2. Javascript ES6 TypeError: Class constructor Client cannot be invoked without 'new'

    To Fix Javascript ES6 TypeError: Class constructor Client cannot be invoked without 'new' Error just Use --project to specify the path. To solve this error first of all set the below option for tsconfig.json: { "compilerOptions": { "target": "ES6", ... } }
    And after doing this just use --project to specify the path of your tsconfig.json. It will help you.

Solution 1 : Edit the Typescript compiler config file

Just edit the Typescript compiler config file, tsconfig.json, to generate ES2017 Javascript code. This will help you to solve this error.

{
    "compilerOptions": {
        "target": "ES2017",

Solution 2 : Use --project to specify the path

To solve this error first of all set the below option for tsconfig.json:

    {
        "compilerOptions": {
            "target": "ES6",
            ...
        }
    }

And after doing this just use --project to specify the path of your tsconfig.json. It will help you.

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read These Solutions

Leave a Comment