https://github.com/Justineo/nuxt-generate-bug
create-nuxt-appCreate following pages:
pages
ββ ...
ββ test
β ββ foo.vue
ββ test.vue
Run nuxt generate
In dist directory, there will be independent entry HTML file for both /test and /test/foo:
pages
ββ ...
ββ test
β ββ foo.html
ββ test.html
Entry for route path /test is missing:
pages
ββ ...
ββ test
ββ foo.html
If I understand the related docs, you're just creating a nested route (like vanilla Vue-Router does), not really creating the routed for /test.
Have you tried something like this?
pages
ββ ...
ββ test
ββ foo.vue
ββ index.vue
Or this?
pages
ββ ...
ββ test
β ββ foo.vue
β ββ index.vue
ββ test.vue
Thanks, Leo. I'm able to workaround this as you suggested by creating a separate index.vue inside the test directory. But it did create the route for /test without /test/index.vue in the dev mode (See below).

And there is another problem.
pages ββ ... ββ test ββ foo.vue ββ index.vue
This seems to make /test and /test/foo siblings instead of parent/child, which breaks nested routes.
pages ββ ... ββ test β ββ foo.vue β ββ index.vue ββ test.vue
While this will lead to duplication.
I still think it's a problem of nuxt generate itself. It's not producing same result as the server-rendered version.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as πPending will not be automatically marked as stale.
Still experiencing this in the latest version of nuxt-edge.
Reproduction step is the same as mentioned in https://github.com/nuxt/nuxt.js/issues/4562#issue-391398271.
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as πPending will not be automatically marked as stale.
This has caused us a lot of trouble. The workaround I have is causing a significant copy-paste of files.
I was bit by this too. I've found a very easy workaround.
Assume that /a works, /a/b doesn't and /a/b/c does for example. Add /a/b to your nuxt.config.js like so:
module.exports = {
// ... the rest of your here ...
// Workaround for nuxt bug #4562 (https://github.com/nuxt/nuxt.js/issues/4562)
generate: {
routes: [
'/a/b',
]
},
}
And it will generate that page too.
Most helpful comment
This has caused us a lot of trouble. The workaround I have is causing a significant copy-paste of files.