Skip to content

#3394 appears to have broken swizzle #3747

@taylorreece

Description

@taylorreece

🐛 Bug Report

#3394 added a reference to ../../utils/useThemeConfig. That's fine if components are in @docusaurus/theme-classic, but if you swizzle a component you cannot reference that module.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

$ npx @docusaurus/init@next init my-website classic
$ cd my-website
$ npx docusaurus swizzle @docusaurus/theme-classic Footer
Success! Copied @docusaurus/theme-classic Footer to src/theme/Footer.
$ npm run start
Module not found: Can't resolve '../../utils/useThemeConfig' in '/Users/treece/Desktop/my-website/src/theme/Footer'

Expected behavior

I'd expect the website to start, with a swizzled Footer

Actual Behavior

Site fails to start; Module not found: Can't resolve '../../utils/useThemeConfig' in '/Users/treece/Desktop/my-website/src/theme/Footer'

Your Environment

  • Docusaurus version used: 2.0.0-alpha.66
  • Environment name and version: Nodejs v12.16.2
  • Operating system and version (desktop or mobile): MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions