Next.js Discord

Discord Forum

Broken app router?

Unanswered
French Lop posted this in #help-forum
Open in Discord
Avatar
French LopOP
The images are the router and output. Whats wrong? Im generating a static build,
My config

/** @type {import('next').NextConfig} */
const nextConfig = {
        output:'export',
        basePath: '/public/prices',
        assetPrefix: '/public/prices/',
}

module.exports = nextConfig
Image
Image

55 Replies

Avatar
French LopOP
was there some update i missed?
Avatar
what the issue are you facing? fail to build?
Avatar
French LopOP
No like the /admin route is a file now?
it used to be /admin/index.html and /admin/login/index.html
Avatar
because you have admin/page.tsx?
what is inside the admin folder?
Avatar
French LopOP
/admin/page.tsx
/admin/login/page.tsx
it used to be like /admin/index.html a few months ago
(when i last compiled it
Avatar
were you using page router?
Avatar
French LopOP
yee
i think
am i stupid
how do i switch back
Avatar
is everything working fine?
Avatar
French LopOP
no
it isnt
thats the thing
theres a million different problems now
Avatar
what is the issue?
Avatar
French LopOP
whenever i click a button cause im using

                router.push('/admin')
it pushed to muscatbullion.com/prices/admin/
instaed of /prices/admin.html
Avatar
I think you don't need basePath and assetPrefix there, do you?
Avatar
French LopOP
i do
cause the website developer was stupid enough to route everything to /public/
i was just creating a seperate page
Avatar
oh ok lol
Avatar
French LopOP
es
es
yes*
its very annoying
cant i switch back
i dont wanna rewrite the whole frontend
Avatar
you just migrated to app router?
Avatar
French LopOP
no
it automatically did it
Avatar
no it won't
Avatar
French LopOP
ig i was using v12 back in the day
idk i just cloned this gh repo cause there was a bug
and it all started messing the hell up
note:
import { useRouter } from 'next/navigation';
im sorry if im being a pain but im honestl very confused
Avatar
no worries
Avatar
French LopOP
can i show u the live demo
Avatar
sure
Avatar
French LopOP
wait there isnt a vc
wait okay lets rewind back to the start
basically i was using app router i believe
Avatar
ah ok
Avatar
French LopOP
everything worked fine
but now all of a sudden everything is broken
and i have no clue why
Avatar
where do you host the site?
have you changed anything on the server?
in this case, I think you need to remove the .html extension and trailing slash on the http server