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.

[HELP] Next-routes problem?

See original GitHub issue

Hello! I’m running latest next version with a typescript environment with a simple next-routes config, but I’m stucked with a problem.

What’s the problem?

I’m running the project, and when I access directly by url /dashboard/job/create/template/:id, it works as expected without problem. If I access other page and use the Link component or Router api, my next app just says [HMR] bundle rebuilding.

I have inserted a log in next router routeChangeStart event and it starts to load the url /dashboard/job/create/template/:id, but never ends in routeChangeComplete or routeChangeError event.

If I access directly from URL /dashboard/job/create/template/:id, go for some component, and back to /dashboard/job/create/template/:id using the Link component or Router api, it also work as expected…

Here’s my route config:

module.exports = routes.add(
  'createTemplate',
  '/dashboard/job/create/template/:id',
  'dashboard/job/create/template/create'
)

Here’s my page folders:

- pages
  - dashboard
    - job
       index
      - create
        - template
          create
          index
....

Anyone could help me?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
davegonzalezcommented, Feb 19, 2019

I’m actually running into this with Next.js v8.0.1 with the React-Slick package. If I import the css files into the top level page, routing via the Link component stops working for that page. Similar to @ntgussoni, I also have withCSS setup in my project, based on the Next.js example.

For now, I’ve just been working around it by inserting the cdn link into a <Head> component.

1reaction
ntgussonicommented, Feb 19, 2019

@ntgussoni Probably for me was the css too… I was importing a .css in the component which I was using the react-day-picker, but I didn’t find out that was the css file that was causing the issue… Good catch! Now I think is easier to someone help to improve this problem…

For while… @ntgussoni if you want to solve this problem, load the component which you are importing the css, with dynamic inside the page…

The sollution I found somewhere is to import an empty css in the _app file. Hope it helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

NextJS and next-routes not routing as I would expect
const nextRoutes = require('next-routes'); const routes ... just some syntax issues. example here github.com/pkellner/next-routes-problem.
Read more >
Routing: Introduction - Next.js
The Next.js router allows you to do client-side route transitions between pages, similar to a single-page application. A React component called Link is...
Read more >
Developer Support - Plasmic Community
Error : The file “/vercel/path0/.next/routes-manifest.json” couldn't be found. This is normally caused by a misconfiguration in your project.
Read more >
now-next-routes - npm
Start using now-next-routes in your project by running `npm i ... now-next-routes was created in order to resolve these issues.
Read more >
next-routes examples - CodeSandbox
Learn how to use next-routes by viewing and forking next-routes example apps on CodeSandbox.
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