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 π¦

9 Replies
fascinating-indigoOPβ’2y ago
OK, fixed it using this: https://github.com/microsoft/TypeScript/issues/42873#issuecomment-1007540868
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-indigoOPβ’2y ago
Well, I though that was the end of it, but then I got this one:

fascinating-indigoOPβ’2y ago
It works if I import all of the react-query π€

fascinating-indigoOPβ’2y ago
Well, this breaks react-query types π
It looks like installing
@tanstack/query-core fixed it for now π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β’2y ago
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-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β’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-indigoOPβ’2y ago
It's actually working fine in vscode but not in my editor (Helix.)