question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Multi-level routing does not work under next.js

See original GitHub issue

Describe the bug Due to the way next.js routing is setup: [resource]->[action]->[id], multi-level routing breaks when trying to access a resource under a parent resource

To Reproduce Steps to reproduce the behavior:

  1. Clone and run yarn dev on https://github.com/smparekh/refine-test
  2. Click on β€˜CMS’
  3. Click on β€˜Posts’
  4. Posts will not be displayed as expected

Expected behavior When routing to a resource under a parentResource it should still handle it the same way as a top-level menu item

Screenshots WITH POSTS UNDER CMS:

Screen Shot 2022-04-12 at 18 49 12

WITH POSTS AT TOPLEVEL: Screen Shot 2022-04-12 at 18 50 35

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Firefox
  • Version:
  • Used: supabase, next.js, antd, custom layout

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]
  • Used dataProvider [e.g. custom, Strapi, Airtable]

Additional context

@pankod/refine-antd@3.12.2
β”‚  β”œβ”€ @ant-design/icons@^4.5.0
β”‚  β”œβ”€ @pankod/refine-core@^3.12.1
β”‚  β”œβ”€ antd@^4.17.1
β”‚  β”œβ”€ dayjs@^1.10.7
β”‚  β”œβ”€ react-markdown@^6.0.1
β”‚  β”œβ”€ react-query@^3.19.2
β”‚  β”œβ”€ remark-gfm@^1.0.0
β”‚  β”œβ”€ sunflower-antd@1.0.0-beta.3
β”‚  └─ tslib@^2.3.1
β”œβ”€ @pankod/refine-core@3.12.1
β”‚  β”œβ”€ export-to-csv-fix-source-map@^0.2.1
β”‚  β”œβ”€ humanize-string@^2.1.0
β”‚  β”œβ”€ lodash-es@^4.17.21
β”‚  β”œβ”€ lodash@^4.17.21
β”‚  β”œβ”€ papaparse@^5.3.0
β”‚  β”œβ”€ pluralize@^8.0.0
β”‚  β”œβ”€ qs@^6.10.1
β”‚  β”œβ”€ react-query@^3.19.2
β”‚  └─ tslib@^2.3.1
β”œβ”€ @pankod/refine-nextjs-router@3.12.1
β”‚  β”œβ”€ @pankod/refine-core@^3.12.1
β”‚  └─ qs@^6.10.1
β”œβ”€ @pankod/refine-supabase@3.12.1
β”‚  β”œβ”€ @pankod/refine-core@^3.12.1
β”‚  └─ @supabase/supabase-js@^1.22.4

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
biskuvitcommented, Apr 15, 2022

Hey @smparekh, Thank you for reporting a bug. I fixed your issue. Can you try again?

0reactions
omeraplakcommented, Apr 15, 2022

@omeraplak - I can make the update to the document

@biskuvit - What was the update to? refine or superplate?

thanks

Hey @smparekh , We’ve updated superplate. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

2 levels nested routing in nextjs - Stack Overflow
I want dynamic routing at two levels. E.g.: {siteroot}/dynamicPage; {siteroot}/dynamicUrlSection/dynamicPage. My folder structure is: /Β ...
Read more >
How to implement redirects in Next.js - LogRocket Blog
Redirects enable users to transfer an executed URL to a new URL to reroute an incoming request from one path to another.
Read more >
Routing: Introduction - Next.js
Next.js has a file-system based router built on the concept of pages. When a file is added to the pages directory, it's automatically...
Read more >
Shallow Routing - Next.js
When shallow routing is used with middleware it will not ensure the new page matches the current page like previously done without middleware....
Read more >
Advanced Features: Internationalized Routing - Next.js
js has built-in support for internationalized (i18n) routing since v10.0.0 . You can provide a list of locales, the default locale, and domain-specific...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found