Skip to content

[v2] Alpha 66 breaks classic site without logo #3610

Description

@SamChou19815

🐛 Bug Report

In #3394, we no longer give logo field a dummy empty object if it's undefined, which will cause it to crash at line 19:

const {
navbar: {logo},
} = useThemeConfig();
const {isDarkTheme} = useThemeContext();
const logoLink = useBaseUrl(logo.href || '/');

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

Upgrade a classic site without logo to alpha-66.

Expected behavior

Sites without logo property should continue to work

Actual Behavior

Blank screen with js error:

Screen Shot 2020-10-19 at 14 47 37

Your Environment

  • Docusaurus version used: v2-alpha-66
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Chrome
  • Operating system and version (desktop or mobile): macOS

Reproducible Demo

https://github.com/SamChou19815/website/tree/master/packages/blog

Bump it to alpha-66, and yarn start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions