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

Gatsby dev server crashes on root URL #142

Open
philschonholzer opened this issue Oct 6, 2021 · 0 comments
Open

Gatsby dev server crashes on root URL #142

philschonholzer opened this issue Oct 6, 2021 · 0 comments

Comments

@philschonholzer
Copy link

philschonholzer commented Oct 6, 2021

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",
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

1 participant