astro icon indicating copy to clipboard operation
astro copied to clipboard

Language switcher not working in "docs" example

Open pReya opened this issue 1 year ago • 5 comments

What version of astro are you using?

v1.2.3

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Mac

Describe the Bug

When creating a new page according to the readme.md of the docs example, the language switcher won't work.

To recreate:

  1. Create new project with the docs template
  2. Add a new language to config.ts, e.g.
export const KNOWN_LANGUAGES = {
  English: "en",
  German: "de",
} as const;
  1. Create localized content file, e.g. pages/de/introduction.md
  2. Open the english introduction page
  3. Click on "German" in the language switcher -> nothing happens

I'm getting a Preact hydration error in the console:

Uncaught (in promise) TypeError: can't define property "__": Object is not extensible

Not sure if this is related to the language switcher problem.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-buwkrs?file=src/pages/de/introduction.md

Participation

  • [ ] I am willing to submit a pull request for this issue.

pReya avatar Sep 14 '22 11:09 pReya