Skip to content
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

Regression - nuxt generate doesn't generate static routes #82

Closed
saintplay opened this issue May 6, 2018 · 8 comments
Closed

Regression - nuxt generate doesn't generate static routes #82

saintplay opened this issue May 6, 2018 · 8 comments

Comments

@saintplay
Copy link

Version

v3.1.0

Reproduction link

https://github.com/paulgv/nuxt-i18n-example

Steps to reproduce

Running nuxt generate in version 3, only generates index.html.

In version 2 nuxt-generate generates all static routes

What is expected ?

All routes statically generated

What is actually happening?

Only index.html is generated

This bug report is available on Nuxt.js community (#c77)
@ghost ghost added the cmty:bug-report label May 6, 2018
@tajnymag
Copy link

tajnymag commented May 7, 2018

Can confirm.

@paulgv
Copy link
Collaborator

paulgv commented May 9, 2018

Hi! I'll give this a try ASAP!

@tajnymag
Copy link

tajnymag commented May 13, 2018

Even though it's not really a complete solution, what works is to add this to nuxt.config.js:

generate: {
  routes: [ '/', '/posts/', '/fr/' ] // <-- an array with all the routes that you need to be rendered
}

@Diferno
Copy link

Diferno commented Jun 3, 2018

Hi friends, any status on this fix? (don't mean to put pressure or anything ;) )

@SnirShechter
Copy link

Stuck with this bug also,
Seems like the index.html is the only route generated.

achretien pushed a commit to achretien/nuxt-i18n that referenced this issue Jun 6, 2018
In nuxt 1.4.0, the method used during static generation test if children exist but not if children is empty.

By overwriting the children value to [] we automatically filter out the routes

see: https://github.com/nuxt/nuxt.js/blob/85b584693cd1e689406ad722b47735fa7d0faf26/lib/common/utils.js#L193
@achretien
Copy link

@Diferno @SnirShechter can you test my branch on your website to check if it generate everything for you?

@paulgv paulgv closed this as completed in ff127a5 Jun 6, 2018
@dschreij
Copy link

dschreij commented Jun 18, 2018

I am still experiencing this problem with nuxt-i18n v4.0.0
The only routes that are generated for me are for index.html, and some dynamic routes I generate in the generate: { routes() } setting. For the other pages, the routes are not automatically generated.
I have to manually construct the list of routes as described by @tajnymag, including the language prefrix and translation of each route

@Diferno
Copy link

Diferno commented Jul 25, 2018

Upgraded nuxt-i18n to 3.3.1 and generates as a charm. Thx

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

No branches or pull requests

7 participants