Hey all so I have an app that I am working on which I am creating using Next.js
.
Almost every single time I make a change the server auto compiles with the new changes which are fine. However most of the time the pages just fail to render properly.
Sometimes it takes minutes to render them properly and I have to constantly restart the server manually multiple times just to get the pages to load properly. Does anyone know what could be causing this?
I don't currently have a next.config.js
file would I need to create one and add some settings to fix these problems?
And also the page routing does not work in production builds. The index.js
page loads fine but none of the routes work when I click on a link they all end in a 404. Even if I type the URL in the browser.
I solved the issue months ago I am just adding the solution I used. It seems to be some sort of git bug maybe some of the files are getting cached somewhere on git or on Netllify which is corrupting it I'm not sure. The only way I managed to it working was to create a brand new git repo and then deploy it to a new site from git on Netlify.
npm install
next build && next export
I encounter a similar problem like yours. In dev build all is good , but when it comes to prod build it sort of broke . I suspect it is because of my dependencies of with-iron-session is deprecated but your post is the second post that says make sure the components in the folder pages is in lower case. Is it true about the lowecase components name in pages folder ?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.