Error importing @convex-dev/react-query in expo project
I'm getting the following error trying to import this package in expo project
Cannot find module '@convex-dev/react-query' or its corresponding type declarations.
There are types at 'node_modules/@convex-dev/react-query/dist/esm/index.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.
5 Replies
Thanks @appixel.dev, I'll look into this!
I always wonder if we can get away without Node10 module resolution but clearly lots of folks need it.
@appixel.dev have you tried following these instructions, updating your tsconfig.json moduleResolution setting to "bundler"?
There are some things that just aren't possible in an expo project, but I thought this might work.
I use bundler resolution in expo, no issues
@ballingt Yeah i have tried that and did clear up errors in my IDE but metro is throwing errors now could be something in my mono repo setup but still troubleshooting
importing this way works without changing any of the tsconfig settings and sticking to default tsconfig generated by expo project
import { ConvexQueryClient } from '@convex-dev/react-query/dist/esm';
I just published 0.0.0-alpha.5, this should work with normal syntax now if you install the latest.
I just checked normal import works now. thanks!