stream-chat-js icon indicating copy to clipboard operation
stream-chat-js copied to clipboard

Type error in client.ts

Open DmitryMarkov opened this issue 1 year ago • 2 comments

Hello, after update to version 8.12.0, I receive this tsc error in my project, what can I do here?

$ tsc -p tsconfig.json --noEmit --pretty
node_modules/stream-chat/src/client.ts:1784:45 - error TS2345: Argument of type 'string | ChannelData<StreamChatGenerics>' is not assignable to parameter of type 'string'.
  Type 'ChannelData<StreamChatGenerics>' is not assignable to type 'string'.

1784     return this.getChannelById(channelType, channelIDOrCustom, custom);
                                                 ~~~~~~~~~~~~~~~~~


Found 1 error in node_modules/stream-chat/src/client.ts:1784

Running on node 18, This is my tsconfig.json:

{
  "compilerOptions": {
    "allowJs": false,
    "allowSyntheticDefaultImports": true,
    "alwaysStrict": true,
    "baseUrl": "./src",
    "checkJs": false,
    "declaration": false,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "jsx": "react",
    "lib": ["dom", "esnext"],
    "module": "esnext",
    "moduleResolution": "node",
    "noImplicitAny": true,
    "noImplicitReturns": false,
    "noImplicitThis": true,
    "noStrictGenericChecks": false,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "outDir": "dist",
    "paths": {
      "components/*": ["components/*"],
      "containers/*": ["containers/*"],
      "enums/*": ["enums/*"],
      "microapps/*": ["microapps/*"],
      "pages/*": ["pages/*"],
      "router/*": ["router/*"],
      "store/*": ["store/*"],
      "utils/*": ["utils/*"]
    },
    "pretty": true,
    // Keep comments for webpackChunkNames.
    "removeComments": false,
    "resolveJsonModule": true,
    "rootDir": ".",
    "skipLibCheck": true,
    "sourceMap": true,
    "strictNullChecks": false,
    "target": "es2018"
  },
  "exclude": ["public", "node_modules", "dist"],
  "include": ["src"]
}

DmitryMarkov avatar Nov 20 '23 13:11 DmitryMarkov

Can someone from your team react on this? It's impossible to use your SDK in TS project

tarasom avatar Jan 04 '24 11:01 tarasom

Will be great to know solution for that. We have the same issue...

rnavarych avatar Jan 09 '24 09:01 rnavarych