openscript-ch / gatsby-plugin-i18n-l10n

Gatsby I18n Plugin 🌐, which let you translate pages, content and the url or slugs of pages. Batteries 🔋 included.
https://www.gatsbyjs.com/plugins/gatsby-plugin-i18n-l10n
MIT License
19 stars 2 forks source link

No trailing slash for 404 pages #189

Closed openscript closed 10 months ago

openscript commented 10 months ago
          Hi again @openscript ,

sorry but we have noticed an issue during production build. It's about 404 page

 ERROR  UNKNOWN

Truncated page data information for the failed page "/it/404.html/": {
  "errors": {},
  "path": "/it/404.html/",
  "slicesMap": {},
  "pageContext": {
    "locale": "it-IT",
    "localePagesId": "404.html",
    "translations": [
      {
        "locale": "en-GB",
        "path": "/404.html/"
      }
    ],
    "prefix": "it"
  }
}

failed Building static HTML for pages - 2.622s

Reading docs https://www.gatsbyjs.com/docs/how-to/adding-common-features/add-404-page/ I see that the 404 page is compiled as 404.html, so I think it's a special route where trailingSlash should not be used (my guess)

Thanks for your help

Originally posted by @acocheo in https://github.com/openscript-ch/gatsby-plugin-i18n-l10n/issues/176#issuecomment-1921105990

openscript commented 10 months ago

How the fix works for you @acocheo.

acocheo commented 10 months ago

Tested today. Flawless. GG 🙏