plain-purple
plain-purple4w ago

Why some resources dont appear on sider?

Some resources dont appear on sider
6 Replies
kapa.ai
kapa.ai4w ago
Hi @internal_server_error_enjoyer. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- There are a few reasons why some resources might not appear on the sider in refine: 1. Access Control: If you're using an access control provider, resources that the user doesn't have permission to access won't appear in the sider menu. This is mentioned in the Authorization documentation (https://refine.dev/docs/authorization/access-control-provider/#list-of-default-access-control-points). 2. Hidden Resources: You can explicitly hide resources from the sider menu by setting the meta.hide property to true in the resource definition. This is described in the FAQ documentation (https://refine.dev/docs/guides-concepts/faq/#how-to-hide-items-from-the-sider-component). 3. Missing list Property: Resources without a list property defined won't appear in the sider menu by default. This is because the sider typically shows links to list pages for resources. 4. Parent Resources: If you're using a multi-level menu structure with parent resources, make sure the parent resources are correctly defined and linked to their children using the parentName property. 5. Asynchronous Loading: If you're loading resources asynchronously, there might be a delay before they appear in the sider. If you're still experiencing issues with resources not appearing in the sider, you may want to check your resource definitions and access control settings. If the problem persists, it could be a bug, and you might want to consult the refine documentation or open an issue on their GitHub repository. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4w ago
<@492429659154415657> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
generous-apricot
generous-apricot4w ago
Hello @internal_server_error_enjoyer, we need more information to debug this issue. do you use access control ? what is your Refine resources looks like?
deep-jade
deep-jade4w ago
Not sure if it's the same issue, but it seems to be related, we are experiencing something similar. We are not using access control (yet). We have opted for a different approach than the recommended, so we can have the routes and resources defined next to the pages. When we are on the default list view, we see 2 items in the sider, but if we click on the new one we just added, the first one disappears from the sider.
generous-apricot
generous-apricot4w ago
Could you create a small reproducible example so I can debug it?
deep-jade
deep-jade4w ago
I have not managed to create a repro, but I think I know where the problem is, just not what it is. When console logging the useMenu hook in the first menu items list view, we see both our items, but doing the same in the second item list view only shows that second item. So since the themed sider uses the useMenu hook, I think that would be where the issue is. I'll try and dive a bit deeper and see if I can figure out why the useMenu hook is struggling.

Did you find this page helpful?