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
Because TypeScript can't access the type of mutate to correctly set the return type of useGetAllAssets in the .d.ts file.
This error appears:
TS4023: Exported variable useGetAllAssets has or is using name SWRInfiniteMutatorOptions from external module
"/Projects/stuff/node_modules/.pnpm/swr@2.2.5_react@18.2.0/node_modules/swr/dist/infinite/index"
but cannot be named.
Expected Behavior
There should be no TS error, SWRInfiniteMutatorOptions should be available to import.
Repro Steps / Code Example
Code example is shared above.
Additional Context
SWR version: 2.2.5
There is no problem with 2.2.4, other versions are untested.
The text was updated successfully, but these errors were encountered:
ryohidaka
added a commit
to ryohidaka/use-backlog
that referenced
this issue
May 8, 2024
Bug report
Description / Observed Behavior
With 2.2.5 (it's not happening with 2.2.4) you can't have this code:
Because TypeScript can't access the type of
mutate
to correctly set the return type ofuseGetAllAssets
in the .d.ts file.This error appears:
Expected Behavior
There should be no TS error,
SWRInfiniteMutatorOptions
should be available to import.Repro Steps / Code Example
Code example is shared above.
Additional Context
SWR version: 2.2.5
There is no problem with 2.2.4, other versions are untested.
The text was updated successfully, but these errors were encountered: