framework7 icon indicating copy to clipboard operation
framework7 copied to clipboard

Next.js - master detail routes didn't render in server side

Open Elvincth opened this issue 4 years ago • 1 comments

Describe the bug

Next.js : Master detail routes didn't render in the server

To Reproduce

Steps to reproduce the behavior:

  1. Clone https://github.com/framework7io/framework7-nextjs-starter
  2. Replace router.js code into below
/*
  - Routes involved in Next.js routing (main pages) should be used as "asyncComponent"
  - Routes involved in other Framework7 routers (in Views other than main View) should be imported and used directly as "component"
*/
import LeftPanel from './pages/left-panel';

// App routes
export const routes = [
  {
    path: "/about",
    asyncComponent: () => import("./pages/about"),
    master: true,
    // detail routes
    detailRoutes: [
      {
        path: "/",
        asyncComponent: () => import("./pages/index"),
      },
    ],
  },
  {
    path: "/left-panel",
    component: LeftPanel,
  },
  {
    path: '/blog/:postId',
    asyncComponent: () => import('./pages/blog/[postId]'),
  }
];

Then,

  1. Create a master detail route
  2. Click on view source

Expected behavior

master detail pages should also be render on the server

Actual Behavior

master detail pages didn't render in server side

Screenshots

If applicable, add screenshots to help explain your problem.

image

Master detail code didn't render in server image

Elvincth avatar Jun 24 '21 12:06 Elvincth

Yes, right now it is kind of a limitation. Will mark it as feature request

nolimits4web avatar Jun 25 '21 16:06 nolimits4web