T
TanStackβ€’2y ago
fascinating-indigo

Getting a weird error following the react-query-file-based example

I'm trying to migrate our app to tanstack router but after I added react query to the context I ended up with the error in the image. I don't know what to do 😦
No description
9 Replies
fascinating-indigo
fascinating-indigoOPβ€’2y ago
GitHub
The inferred type of "X" cannot be named without a reference to "Y"...
Bug Report πŸ”Ž Search Terms inferred type cannot be named, symlink node_modules πŸ•— Version & Regression Information I'm verifying the problem on the typescript@4.1.3. I've not tried older ...
fascinating-indigo
fascinating-indigoOPβ€’2y ago
Well, I though that was the end of it, but then I got this one:
No description
fascinating-indigo
fascinating-indigoOPβ€’2y ago
It works if I import all of the react-query πŸ€•
No description
fascinating-indigo
fascinating-indigoOPβ€’2y ago
Well, this breaks react-query types πŸ™‚ It looks like installing @tanstack/query-core fixed it for now πŸ˜„
overseas-lavender
overseas-lavenderβ€’2y ago
This shouldn't be required since @tanstack/query-core is included with the @tanstack/react-query install. I'm thinking this could have something to do with your tsconfig or something bugged out in your node_modules. Could you maybe rm -rf your node_modules and try a reinstall?
overseas-lavender
overseas-lavenderβ€’2y ago
Here's my tsconfig for reference.
GitHub
nv-rental-clone/tsconfig.json at 3df0f258fe628d72966f5abc33d1545891...
Navotar with Tailwind and the Tanstack. Contribute to SeanCassiere/nv-rental-clone development by creating an account on GitHub.
fascinating-indigo
fascinating-indigoOPβ€’2y ago
Yeah, but I just tried everything until it workedπŸ₯Ή I did try this quite a few times πŸ˜„ Thanks, I'll see what I can find. BTW, for reference, I'm in a pnpm monorepo.
overseas-lavender
overseas-lavenderβ€’2y ago
Ohhhhhh... Didn't realize we were playing on hard mode. My experiences with monorepos have been hit and miss. Typically, your code editor should detect the folder you are in and pull the closest tsconfig, but I suppose that changes a bit of you extends from a parent config or importing one from a shared package.
fascinating-indigo
fascinating-indigoOPβ€’2y ago
It's actually working fine in vscode but not in my editor (Helix.)

Did you find this page helpful?