Is it possible to make my whole app statically generated with App Router?
Unanswered
Whimbrel posted this in #help-forum
WhimbrelOP
Is it possible to make my whole app statically generated with App Router?
41 Replies
WhimbrelOP
Gotcha, thanks @Ray .
I'm getting this when running with output: export:
⨯ Error: Page "/[...slug]/page" is missing param "/sw.js" in "generateStaticParams()", which is required with "output: export" config.
at DevServer.renderToResponseWithComponentsImpl (../node_modules/next/dist/server/base-server.js:1043:27) {
page: '/sw.js'
I'm getting this when running with output: export:
⨯ Error: Page "/[...slug]/page" is missing param "/sw.js" in "generateStaticParams()", which is required with "output: export" config.
at DevServer.renderToResponseWithComponentsImpl (../node_modules/next/dist/server/base-server.js:1043:27) {
page: '/sw.js'
did you add output: 'export' to next.config?
WhimbrelOP
Yes.
@Whimbrel Gotcha, thanks <@743561772069421169> .
I'm getting this when running with output: export:
⨯ Error: Page "/[...slug]/page" is missing param "/sw.js" in "generateStaticParams()", which is required with "output: export" config.
at DevServer.renderToResponseWithComponentsImpl (../node_modules/next/dist/server/base-server.js:1043:27) {
page: '/sw.js'
look like you missing something in /[...slug]/page
WhimbrelOP
Not sure what is wrong.
Do you have a demo project with output: export?
try changing [...slug] to [slug]?
WhimbrelOP
Tried, it's same.
well I just init a new project and it build fine without error
do you have next-seo package installed?
WhimbrelOP
nop
Not sure why is needed.
Can you share the repo?
WhimbrelOP
The error appears just on runtime.
I don't have any error on build:
where do you get the error
i don't have error on runtime also
WhimbrelOP
Can you share the repo?
you cant use next dev with export:out
"next start" does not work with "output: export" configuration. Use "npx serve@latest out" instead.
WhimbrelOP
Hmm, yes, but I want to run the project on dev mode.
maybe you try clone my repo
WhimbrelOP
danke!
let me know if it works for you or not
WhimbrelOP
hmm, yea, same issue
Probably is just on my side.
I'm using node v20.8.0
try different browser or private mode?
look like you have some plugin or extension looking for sw.js
WhimbrelOP
Yea, probably that's why. In the meantime I've switched it to Pages Router and it doesn't show anymore.
you shouldn't receive the error with app router also after you unregister the worker
WhimbrelOP
yep, thanks!