query data cannot be undefined
I created a new Refine app, using the Remix framework and Headless components.
I tried to implement a small
/logout
route that doesn't exist in the template. It was a little hard because I'm not used to Remix but I did make a page that erases the user cookie on the client and redirects to the login page.
But now I'm getting this message on the browser console that I can't find the source. Apparently it is coming from Tanstack Query, but I'm not using that directly.
I also searched for this key "getUserIdentity"
on my code but it doesn't exist there.11 Replies
Hey @rhengles! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, I can provide you with some helpful documentation on Refine and Remix:
1. Refine with Remix: Refine Remix Documentation (https://refine.dev/docs/packages/documentation/routers/remix)
2. Refine Headless: Refine Headless Documentation (https://refine.dev/docs/examples/remix/remix-headless)
3. Remix Official Documentation: Remix Documentation (https://remix.run/)
These resources should help you better understand how Refine works with Remix and headless components.
----------------------
Remix | refine
refine provides router bindings and utilities for Remix. This package will provide easy integration between refine and Remix for both existing projects and new projects without giving up the benefits of Remix.
Headless | refine
refine allows you to build your SSR supported web applications using Remix. With this example, you can see how to make a simple SSR supported headless (without any style/component) CRUD App.
Remix - Build Better Websites
Remix is a full stack web framework that lets you focus on the user interface and work back through web standards to deliver a fast, slick, and resilient user experience. People are gonna love using your stuff.
<@246421183484919808> kapa.ai is still learning and improving, please let us how it did by reacting below
exotic-emerald•2y ago
refine uses TanStack query under the hood. You can return null or any other object on getUserIdentity method. TanStack don't want to undefined as a result.
genetic-orange•2y ago
Um yes, but I didn't create this
getUserIdentity
, and it is not on the /app
folderexotic-emerald•2y ago
if you are using header or layout from refine, we are using useGetIdentity to render user on header
genetic-orange•2y ago
maybe it's something on my auth provider, I used the client side cookies example (I saw the docs page with this code but I'm not finding it right now)
I modified it slightly to call my data provider to actually login
I'll paste it here
exotic-emerald•2y ago
getCookieIdentity returns undefined, just return null instead
genetic-orange•2y ago
ah good!
exotic-emerald•2y ago
🚀
genetic-orange•2y ago
Awesome, that was it!
Thanks for the quick reply! 💯