GetStream / react-activity-feed

Stream React Activity Feed Components
https://getstream.io/react-activity-feed/
BSD 3-Clause "New" or "Revised" License
137 stars 83 forks source link

Typescript error in getstream (using StreamApp) #298

Closed tomjohnhall closed 3 years ago

tomjohnhall commented 3 years ago

Build time error when importing { StreamApp } from 'react-activity-feed' in a react project with

TypeScript error in .../node_modules/getstream/lib/client.d.ts(97,35):
',' expected.  TS1005

     95 | export declare type RealTimeMessage<UserType extends UR = UR, ActivityType extends UR = UR, CollectionType extends UR = UR, ReactionType extends UR = UR> = {
     96 |     deleted: Array<string>;
  >  97 |     deleted_foreign_ids: Array<[id: string, time: string]>;
        |                                   ^

getstream@7.2.11

Any idea how to get around this?

ferhatelmas commented 3 years ago

cc @MartinCupela

MartinCupela commented 3 years ago

Hi @tomjohnhall, I could not reproduce the problem on my machine with getstream@7.2.11 and react-activity-feed@1.2.1. I used to get these type errors when I let my Webstorm do funny imports. Could you please attach the code, that would show the StreamApp component import? Just trying to start somewhere.

ferhatelmas commented 3 years ago

How about TS version?

tomjohnhall commented 3 years ago

@MartinCupela @ferhatelmas It was a typescript version issue in the end. I thought I'd already upgraded but obviously my yarn upgrade wasn't enough, I had typescript at 3.9.7 and I'm now at 4.4.3 and the import works.

I also had to install @typescript-eslint/eslint-plugin and @typescript-eslint/parser at ^4.1.1 for anyone who comes across someting similar in future.

Thanks for your help.