Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3394 appears to have broken swizzle #3747

Closed
taylorreece opened this issue Nov 13, 2020 · 2 comments · Fixed by #3775
Closed

#3394 appears to have broken swizzle #3747

taylorreece opened this issue Nov 13, 2020 · 2 comments · Fixed by #3775
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@taylorreece
Copy link
Contributor

🐛 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
@taylorreece taylorreece added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Nov 13, 2020
@slorber
Copy link
Collaborator

slorber commented Nov 16, 2020

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

@slorber slorber linked a pull request Nov 18, 2020 that will close this issue
@slorber
Copy link
Collaborator

slorber commented Nov 18, 2020

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

#3775

@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
3 participants