Closed BramDecuypere closed 1 year ago
I've got the same problem on a project, basically no links are working when landing on the page, but if I navigate to it from another one, it's working. It only happens on production.
Same problem here also.
Did anyone find a workaround/fix for this?
Did anyone find a workaround/fix for this?
My problem was related to Webpack, NextJS and Ant Design using less.
In case anyone has the same problem as I had, here's how I fixed it:
It happened only when a page without Ant Design was trying to navigate to a page with Ant Design on it.
The fix was to manually load all the used less files across the project into _app.js
:
import 'antd/lib/style/index.less'
import 'antd/lib/layout/style/index.less'
[...]
And disable styles import in .babelrc
:
[
"import",
{
"libraryName": "antd",
"style": false
}
],
It's not ideal, but it's actually the only way to make it work with the current version of Webpack & NextJS.
Good luck!
Thanks @watch-janick ! This really helped. I was able to fix this by importing bootstrap css file in _app.js
Description: A complex link doesn't work when first landing on a static page with a normal link. But does when first navigating to the complex link, moving towards another (static) page. And then navigating to the complex link. (it is not reproducible in a local environment)
Here is the website I'm talking about. I have no clue when it got introduced or for how long it has been there. But obviously I want to get this fixed quick.
www.lizy.be/nl/leasing-auto - Complex link www.lizy.be/nl/over-ons - simple link
Scenario:
Might it be something with the way next-routes is wrapped around this a-tag? Any insights would be very much appreciated. I have the feeling some JS error might be swallowed, but I have no indication or idea on how to get this fixed fast. Any pointers on how to debug this
Here is the setup:
Minimal version:
routes.js (as defined by next-routes)
The paths as defined by next.config: Next to that I also have paths generated for all the models/cars available to have them as static pages as well inside my application and they become easy to navigate.
The Link button is defined like this: