gatsbyjs / themes

This is a repo for Gatsby's official themes.
138 stars 78 forks source link

Gatsby dev server crashes on root URL #142

Open philschonholzer opened 2 years ago

philschonholzer commented 2 years ago

If I open the root url localhost:8000/ the gatsby dev server will crash if SSR is enabled.

If SSR is not enabled or I enter localhost:8000/de/ it will not crash.

Cannot read property 'matchPath' of undefined

  TypeError: Cannot read property 'matchPath' of undefined

  - render-dev-html.ts:181 
    [gcb-shop]/[gatsby]/src/utils/dev-ssr/render-dev-html.ts:181:17

  - new Promise

  - render-dev-html.ts:171 renderDevHTML
    [gcb-shop]/[gatsby]/src/utils/dev-ssr/render-dev-html.ts:171:3

  - start-server.ts:732 
    [gcb-shop]/[gatsby]/src/utils/start-server.ts:732:40

./locale/config.json

[
  {
    "code": "de",
    "hrefLang": "de-CH",
    "name": "German",
    "localName": "Deutsch",
    "langDir": "ltr",
    "dateFormat": "DD.MM.YYYY"
  },
  {
    "code": "fr",
    "hrefLang": "fr-CH",
    "name": "French",
    "localName": "Francaise",
    "langDir": "ltr",
    "dateFormat": "DD.MM.YYYY"
  },
  {
    "code": "en",
    "hrefLang": "en-US",
    "name": "English",
    "localName": "English",
    "langDir": "ltr",
    "dateFormat": "MM/DD/YYYY"
  }
]

gatsby-config.js

//...
    {
      resolve: `gatsby-theme-i18n-lingui`,
      options: {
        localeDir: `./locale`,
      },
    },
    {
      resolve: `gatsby-theme-i18n`,
      options: {
        defaultLang: 'de',
        configPath: require.resolve(`./locale/config.json`),
      },
    },
// ...

package.json

    "gatsby": "^3.14.0",
    "gatsby-theme-i18n": "^2.0.0",
    "gatsby-theme-i18n-lingui": "^2.0.0",