Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

ChatwootClient is not a constructor #8

Description

@ozzyoss77

I'm using typescript.
When importing, I don't get any errors, but when starting the project, I get the following error:
TypeError: ChatwootClient is not a constructor at <anonymous> (/home/ozzyoss77/Workspace/evobot-chatwoot/src/Utils/regex.ts:14:16) at ModuleJob.run (node:internal/modules/esm/module_job:268:25) at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:543:26) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)

import ChatwootClient from "@figuro/chatwoot-sdk";
// console.log(ChatwootClient);

const client = new ChatwootClient({
    config: {
        basePath: "https://app.chatwoot.com",
        with_credentials: true,
        credentials: "include",
        token: "itoken"
    }
});

ChatwootClient log:

{
  ApiError: [Getter],
  CancelablePromise: [Getter],
  CancelError: [Getter],
  ChatwootAPI: [Getter],
  default: [class ChatwootClient]
}

This is my tsconfig.json configuration:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ES2022",
    "declaration": false,
    "declarationMap": false,
    "moduleResolution": "node",
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": false,
    "outDir": "./dist",
    "baseUrl": "./",
    "rootDir": "./",
    "incremental": true,
    "skipLibCheck": true,
    "paths": {
      "~/*": ["./src/*"]
    }
  },
  "include": [
    "**/*.js",
    "**/*.ts"
  ],
  "exclude": [
    "node_modules",
    "dist",
    "**/*.test.ts",
    "**/*.spec.ts",
    "**e2e**",
    "**mock**"
  ]
}

Am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions