Skip to content

Generating nested routes while trailingSlash is true #8165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cain opened this issue Oct 8, 2020 · 5 comments
Closed

Generating nested routes while trailingSlash is true #8165

cain opened this issue Oct 8, 2020 · 5 comments

Comments

@cain
Copy link

cain commented Oct 8, 2020

Versions

  • nuxt: 12.14.6

Reproduction

Visit the link and inside sandbox terminal run: npm run generate
https://codesandbox.io/s/nuxt-generate-trailing-slash-bug-x7bhd?file=/nuxt.config.js

Steps to reproduce

  1. Setup nested routes https://nuxtjs.org/guide/routing#nested-routes
/pages/about.vue
/pages/about/company.vue # or /pages/about/company/index.vue
  1. Enable trailingSlash: true inside nuxt.config
  2. Run command nuxt generate to generate nested pages

What is Expected?

Success generation of nested routes containing trailing slash.

✔ Generated route "/about/company/"
✔ Generated route "/about/info/"  

What is actually happening?

The command is failing with error This page could not be found and missing trailing slashes on nested routes.

Note: the build actually completes without issues, just seems to be the build error.

Error generating route "/about/company": This page could not be found
Error generating route "/about/info": This page could not be found

Kapture 2020-10-08 at 17 29 37

@cain cain added the bug-report label Oct 8, 2020
@cain
Copy link
Author

cain commented Oct 8, 2020

Can someone please help confirm this bug, and also point me in the right direction for where to fix this. Thanks :)

@cain cain changed the title Generate nested routes with trailingSlash true (trailing slash on) Generate nested routes with trailingSlash true Oct 13, 2020
@cain cain changed the title Generate nested routes with trailingSlash true Generating nested routes while trailingSlash is true Oct 13, 2020
@mahapo
Copy link

mahapo commented Oct 28, 2020

@cain +1 Trailing slash are needed for netflify

@mornir
Copy link

mornir commented Oct 28, 2020

Yes! This is a bug! (which is actually is regression, before 2.14.0 it was working fine). Reporting this bug was on my todo list for awhile. Thanks for reporting and opening a pull request!
(With fallback set to true, those not found routes are still accessible. Or you can manually add them in routes.)
To be more accurate, the problem occurs when using nuxt-child.

@pi0 pi0 mentioned this issue Dec 1, 2020
@pi0
Copy link
Member

pi0 commented Dec 1, 2020

This should be fixed in v2.14.8. Please reopen if not.

@pi0 pi0 closed this as completed Dec 1, 2020
@mornir
Copy link

mornir commented Dec 1, 2020

I've just upgraded to v.2.14.8 and my nested routes are correctly generated!😃 Thanks everyone for the fix!👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants