Broken app router?
Unanswered
French Lop posted this in #help-forum
French LopOP
The images are the router and output. Whats wrong? Im generating a static build,
My config
My config
/** @type {import('next').NextConfig} */
const nextConfig = {
output:'export',
basePath: '/public/prices',
assetPrefix: '/public/prices/',
}
module.exports = nextConfig
55 Replies
French LopOP
was there some update i missed?
what the issue are you facing? fail to build?
French LopOP
No like the /admin route is a file now?
it used to be /admin/index.html and /admin/login/index.html
because you have
what is inside the admin folder?
admin/page.tsx
?what is inside the admin folder?
French LopOP
/admin/page.tsx
/admin/login/page.tsx
/admin/login/page.tsx
it used to be like /admin/index.html a few months ago
(when i last compiled it
were you using page router?
French LopOP
yee
i think
am i stupid
how do i switch back
is everything working fine?
French LopOP
no
it isnt
thats the thing
theres a million different problems now
what is the issue?
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
I think you don't need
basePath
and assetPrefix
there, do you?French LopOP
i do
cause the website developer was stupid enough to route everything to /public/
i was just creating a seperate page
oh ok lol
French LopOP
es
es
yes*
its very annoying
cant i switch back
i dont wanna rewrite the whole frontend
you just migrated to app router?
French LopOP
no
it automatically did it
no it won't
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
no worries
French LopOP
can i show u the live demo
sure
French LopOP
wait there isnt a vc
wait okay lets rewind back to the start
basically i was using app router i believe
ah ok
French LopOP
everything worked fine
but now all of a sudden everything is broken
and i have no clue why
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