question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docusaurus-lunr-search Swizzle command fails

See original GitHub issue

🐛 Bug Report

Docusaurus swizzle command fails to copy the SearchBar to src/theme/SearchBar.

Fix

  1. Install this package
npm i docusaurus-lunr-search  --save
  1. Then run
npm install

before the swizzle command to update, build, and link the packages. 2. Then run docusaurus swizzle

npm run swizzle docusaurus-lunr-search SearchBar -- --danger

The swizzle command works fine now.

fix-docusaurus-swizzle

To Reproduce

  1. Create a new Docusaurus Project (or migrate from an older one): npx @docusaurus/init@latest initi my-website classic
  2. Install the latest Docusaurus Lunr search package: npm i docusaurus-lunr-search --save
  3. Run the swizzle command: npm run swizzle docusaurus-lunr-search SearchBar -- --danger Runs into error.

Expected behavior

  1. swizzle success message: Screenshot 2020-12-02 at 12 01 32

  2. SearchBar copied in the right location: Screenshot 2020-12-02 at 11 55 26

Actual Behavior

Screenshot 2020-12-02 at 11 56 04

Your Environment

  • Docusaurus version used: 2.0.0-alpha.69
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): v12.19.0
  • Operating system and version (desktop or mobile): macOS Big Sur

Reproducible Demo

https://github.com/lelouch77/docusaurus-lunr-search.

If you skip this step, your site will not be enabled with the Lunr search box feature.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
GatoVueltacommented, Jul 19, 2022

Having similar issue, but instead, I get:

[ERROR] Theme docusaurus-lunr-search not found. Themes available for swizzle:
- @docusaurus/theme-classic
- @docusaurus/plugin-debug
0reactions
asapachcommented, Aug 29, 2022

I’ve submitted #87

Read more comments on GitHub >

github_iconTop Results From Across the Web

docusaurus-lunr-search Swizzle command fails #3864 - GitHub
Docusaurus swizzle command fails to copy the SearchBar to src/theme/SearchBar. Have you read the Contributing Guidelines on issues? Yes. Fix.
Read more >
Enable Docusaurus2 Lunr offline/local search | Medium
The swizzle command fails :-o !!! Or, yet there is no result when you start typing in the search box. The Solution. The...
Read more >
docusaurus-lunr-search - npm
Start using docusaurus-lunr-search in your project by running `npm ... npm run swizzle docusaurus-lunr-search SearchBar -- --eject --danger.
Read more >
Feedback | Docusaurus
However, after installing it, I couldn't get it to return any search results in ... it is because of my improper configuration, and...
Read more >
How to solve Error: self signed certificate in certificate chain i ...
command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node get-sysinternals-du.js npm ERR! node:events ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found