wails-template-nextjs
wails-template-nextjs copied to clipboard
nextjs with app router is not working
If i replace nextjs frontend folder with newly create app
✔ What is your project named? … frontend
✔ Would you like to use TypeScript with this project? … No / Yes
✔ Would you like to use ESLint with this project? … No / Yes
✔ Would you like to use Tailwind CSS with this project? … No / Yes
✔ Would you like to use `src/` directory with this project? … No / Yes
✔ Use App Router (recommended)? … No / Yes
✔ Would you like to customize the default import alias? … No / Yes
✔ What import alias would you like configured? … @/*
Creating a new Next.js app in /home/camera/dev/concept/frontend.
On navigate to About page url, getting unable to finish request: StatusCodes not supported: 404 - Not Found
But if app create without App router then, it it working fine.
Can you resolve issue with nextjs app using App Router?
Thank you for reporting, but I am unable to reproduce your issue. I will update this project to the latest NextJS and use the app router. I am quite busy moving house at the moment so will get to it as soon as possible.
I am providing complete example code https://github.com/learncodingforweb/wails_next_app_router . Note it is working in development mode. But when app is build, after that running app and on navigate to about page, getting error StatusCodes not supported: 404 - Not Found. Please update solution so that app can be run in production mode.
What operating system are you using? I tested it on both Linux and Windows, and everything was fine on Windows, but I ran into the same issue on Linux. I suspect it's an upstream problem. Wails uses libwebkit as the web container on Linux, and it often encounters some strange issues. I'll continue to investigate this problem.
I found that on Linux, when clicking the link to jump to the about page, the request was /a instead of /about, so it returned a 404 Not Found, and I do not know why this happened, recommend temporarily using pages router for now.
I am running on ubuntu22.04 LTS