eager-pizza-76165
02/27/2023, 5:22 PM@rudderstack/rudder-sdk-react-native package, installed pods, and added the await rudderClient.setup(...) call to the App.tsx. I noticed there’s a problem with top-level await, so I added "module": "esnext" to the compilerOptions in our tsconfig.json. I wanted to verify the typescript setup is correct, so I ran yarn tsc. I got 3 errors, all of them coming from node_modules/@rudderstack/rudder-sdk-react-native/src/RudderClient.ts.
The first two were related to the async-lock package - the types were not available. I worked around this by adding the @types/async-lock package.
The last one is this:
node_modules/@rudderstack/rudder-sdk-react-native/src/RudderClient.ts:191:16 - error TS2394: This overload signature is not compatible with its implementation signature.
191 async function alias(previousId: string, userId: string | Record<string, unknown>): Promise<void>;
~~~~~
node_modules/@rudderstack/rudder-sdk-react-native/src/RudderClient.ts:192:16
192 async function alias(newId: string, options: Record<string, unknown> | null = null) {
~~~~~
The implementation signature is declared here.
Any help here? I can’t see the typecheck run as part of your CI workflows (https://github.com/rudderlabs/rudder-sdk-react-native/tree/master/.github/workflows), so maybe this issue is present in the repo and the check would have caught it?
Anyway, I’m not sure why typescript checks the node_modules, probably because you ship .ts files, not built .js + .d.ts. I have skipLibChecks: true in tsconfig.json.millions-activity-52391
02/27/2023, 5:22 PMeager-pizza-76165
02/27/2023, 7:15 PM.ts files (at least without .d.ts) is basically wrong: https://github.com/microsoft/TypeScript/issues/40426#issuecomment-1373454802eager-pizza-76165
02/27/2023, 11:19 PM"strict": true option in tsconfig.json. I’d like to suggest you to conform to the strict rules as well to solve this problem. I will turn it off on our side as a temporary workaround.high-zoo-17436
02/28/2023, 4:40 AMcalm-yak-10773
02/28/2023, 6:27 AMeager-pizza-76165
02/28/2023, 7:52 AMcalm-yak-10773
02/28/2023, 8:05 AMeager-pizza-76165
02/28/2023, 8:11 AM