Skip to content

运行报错 #81

@no13bus

Description

@no13bus
Cannot read properties of undefined (reading 'map')

components/HeadHrefLangs.astro:10:19
---
import i18next from "i18next";
import { localizeUrl } from "../..";

const supportedLanguages = i18next.languages;
const currentUrl = Astro.url.href;
---

{
  supportedLanguages.map((supportedLanguage) => (
    <link
      rel="alternate"
      hreflang={supportedLanguage}
      href={localizeUrl(currentUrl, supportedLanguage)}
    />
  ))
}

另外不太明白的是page下面有一个index.astro, 但是zh文件夹下没有,那么如果路由是 localhost:43121/zh 怎么识别呢

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions