AgoraIO-Extensions / react-native-agora

React Native around the Agora RTC SDKs for Android and iOS agora
https://www.agora.io
MIT License
622 stars 228 forks source link

Typescript definitions broken #718

Closed radko93 closed 10 months ago

radko93 commented 10 months ago

Describe the bug After an update to 4.2.4 from 4.2.1 Typescript types are broken

Could not find a declaration file for module 'react-native-agora'. '....../node_modules/react-native-agora/lib/commonjs/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/react-native-agora` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-native-agora';`

To Reproduce Import anything from react-native-agora

React Native 0.72.5 and typesctipt 5.1.6.

LichKing-2234 commented 10 months ago

It is a mistake, pls modify this line in node_modules/react-native-agora/package.json, then use patch-package to fix it before the next version.

"types": "lib/typescript/index.d.ts",

to

"types": "lib/typescript/src/index.d.ts",

pls refer to #719

LichKing-2234 commented 10 months ago

The root cause is we upgrading to the latest version of create-react-native-library, but the root file location of types has been changed.

LichKing-2234 commented 10 months ago

Also, you can npm install our SDK by GitHub commit

"react-native-agora": "github:AgoraIO-Extensions/react-native-agora#11c6b3d5b626b91a589b8cf75ef26e0a18ca5ed2",
LichKing-2234 commented 10 months ago

The version 4.2.5 has been released.