Frankwarnaar
0
Frankwarnaar
commented 2 months ago

Version

4.0.0

Reproduction link

https://deploy-preview-81--miele-laundry-club.netlify.com/nl/

Steps to reproduce

Enter a postalCode (for instance 2011JJ) in the input. You will be redirected to another sub route of the index page.

What is expected ?

When you refresh, the page should be found.

What is actually happening?

A 404 is thrown.

Additional comments?

I'm running a static website, using nuxt generate. On the index page, I'm using child routes. My page structure is as the following:
index.vue
index/
index.vue
afspraak-plannen.vue
nog-niet-actief.vue

For the afspraak-plannen.vue and the nog-niet-actief.vue pages, the page is not being generated. Because of this, client side navigating to the child page does work, but the server side (static) version is not found, because it's not generated. While generating I see the following errors:

 Error generating /nl//nog-niet-actief
 Error generating /nl//afspraak-plannen  

It looks like the index folder is not being removed properly from the generated output, causing a duplicate / in the path.

bug
0
michaelize
0
michaelize
commented 24 days ago

Can you post your configuration? Including the path definition in case it's done in-component.

0
Frankwarnaar
0
Frankwarnaar
commented 6 days ago

My nuxt-i18n config, where defaultLocale is nl and locales is:

[
  {
    "code": "nl",
    "name": "Nederlands"
  },
  {
    "code": "en",
    "name": "English"
  }
]
const { locales } = require('../lib/data')
const defaultLocale = locales[0]

/**
 * @see https://nuxt-community.github.io/nuxt-i18n/
 */
module.exports = [
  'nuxt-i18n',
  {
    defaultLocale,
    detectBrowserLanguage: {
      useCookie: true,
      cookieKey: 'i18n_redirected'
    },
    lazy: true,
    langDir: 'static/data/',
    locales: locales.map(locale => ({
      code: locale.code,
      file: `${locale.code}/messages.json`,
      iso: locale.code,
      name: locale.name,
    })),
    rootRedirect: defaultLocale,
    strategy: 'prefix',
    vueI18n: {
      fallbackLocale: defaultLocale,
    }
  }
]

The paths are defined by my folder structure.

0
Informations
Bug Report โ€ข Open
#c181 - Created 2 months ago