You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you has enable "noUncheckedIndexedAccess": true, in your project you can't compile Next.js projects because the package produce types error.
It can be fixed checking the index.
exportfunctionshuffle<TData>(array: TData[]): TData[]{constshuffledArray=array;for(letc=array.length-1;c>0;c--){constb=Math.floor(Math.random()*(c+1));consta=array[c];// Added the ifsif(array[b])shuffledArray[c]=array[b];if(a)shuffledArray[b]=a;}returnshuffledArray;}
Client
All
Version
5.8.1
Relevant log output
node_modules/@algolia/client-common/src/transporter/helpers.ts:11:5 - error TS2322: Type 'TData | undefined' is not assignable to type'TData'.
'TData' could be instantiated with an arbitrary type which could be unrelated to 'TData | undefined'.
11 shuffledArray[c] = array[b];~~~~~~~~~~~~~~~~
node_modules/@algolia/client-common/src/transporter/helpers.ts:12:5 - error TS2322: Type 'TData | undefined' is not assignable to type'TData'.
'TData' could be instantiated with an arbitrary type which could be unrelated to 'TData | undefined'.
12 shuffledArray[b] = a;~~~~~~~~~~~~~~~~
node_modules/@algolia/client-common/src/transporter/helpers.ts:71:5 - error TS2322: Type 'string | undefined' is not assignable to type'string'.
Type 'undefined' is not assignable to type'string'.
71 serializedHeaders[header.toLowerCase()] = value;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 3 errors in the same file, starting at: node_modules/@algolia/client-common/src/transporter/helpers.ts:11
The text was updated successfully, but these errors were encountered:
Hey, thanks for reporting the issue! We shouldn't provide the typescript files in order to prevent those kind of issues, next release will contain the fix :)
Description
If you has enable
"noUncheckedIndexedAccess": true,
in your project you can't compile Next.js projects because the package produce types error.It can be fixed checking the index.
Client
All
Version
5.8.1
Relevant log output
The text was updated successfully, but these errors were encountered: