Skip to content

#3394 appears to have broken swizzle #3747

Closed

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

Activity

  1. added
    bug
    status: needs triage
    on Nov 13, 2020
  2. slorber commented on Nov 16, 2020

    @slorber
    Collaborator

    yes that's bad, we'll fix that asap

  3. linked a pull request that will close this issue@docusaurus/theme-common #3775on Nov 18, 2020
  4. slorber commented on Nov 18, 2020

    @slorber
    Collaborator

    This will be fixed by moving the utils in a new @docusaurus/theme-common package.

    #3775

  5. removed
    status: needs triage
    on Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions