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.

Unable to run yarn build after adding plugin

See original GitHub issue

Please describe the bug you are seeing

I am unable to successfully run yarn build after installing this plugin.

How can we best reproduce the bug?

I just followed the two steps from the instructions:

yarn add @cmfcmf/docusaurus-search-local

and adding the plugin to docusaurus.config.js with:

require.resolve("@cmfcmf/docusaurus-search-local"),

When I run yarn build, I get this error:

[ERROR] Unable to build website for locale en.
[ERROR] Error: docusaurus_tag meta tag not found. This is a bug and should never happen.
    at getDocusaurusTag (/Users/danielkobran/Documents/ps_docs/node_modules/@cmfcmf/docusaurus-search-local/lib/server/parse.js:186:15)
    at /Users/danielkobran/Documents/ps_docs/node_modules/@cmfcmf/docusaurus-search-local/lib/server/index.js:287:58
    at async Promise.all (index 0)
    at async Object.postBuild (/Users/danielkobran/Documents/ps_docs/node_modules/@cmfcmf/docusaurus-search-local/lib/server/index.js:283:32)
    at async /Users/danielkobran/Documents/ps_docs/node_modules/@docusaurus/core/lib/commands/build.js:153:9
    at async Promise.all (index 6)
    at async buildLocale (/Users/danielkobran/Documents/ps_docs/node_modules/@docusaurus/core/lib/commands/build.js:149:5)
    at async tryToBuildLocale (/Users/danielkobran/Documents/ps_docs/node_modules/@docusaurus/core/lib/commands/build.js:33:20)
    at async mapAsyncSequencial (/Users/danielkobran/Documents/ps_docs/node_modules/@docusaurus/utils/lib/index.js:262:24)
    at async build (/Users/danielkobran/Documents/ps_docs/node_modules/@docusaurus/core/lib/commands/build.js:68:25)
error Command failed with exit code 1.

Which version of Docusaurus and @cmfcmf/docusaurus-search-local are you using?

yarn list v1.22.17 β”œβ”€ @cmfcmf/docusaurus-search-local@0.10.0 β”œβ”€ @docusaurus/core@2.0.0-beta.14 β”œβ”€ @docusaurus/cssnano-preset@2.0.0-beta.14 β”œβ”€ @docusaurus/logger@2.0.0-beta.14 β”œβ”€ @docusaurus/mdx-loader@2.0.0-beta.14 β”œβ”€ @docusaurus/plugin-content-blog@2.0.0-beta.14 β”œβ”€ @docusaurus/plugin-content-docs@2.0.0-beta.14 β”œβ”€ @docusaurus/plugin-content-pages@2.0.0-beta.14 β”œβ”€ @docusaurus/plugin-debug@2.0.0-beta.14 β”œβ”€ @docusaurus/plugin-google-analytics@2.0.0-beta.14 β”œβ”€ @docusaurus/plugin-google-gtag@2.0.0-beta.14 β”œβ”€ @docusaurus/plugin-sitemap@2.0.0-beta.14 β”œβ”€ @docusaurus/preset-classic@2.0.0-beta.14 β”œβ”€ @docusaurus/react-loadable@5.5.2 β”œβ”€ @docusaurus/theme-classic@2.0.0-beta.14 β”œβ”€ @docusaurus/theme-common@2.0.0-beta.14 β”œβ”€ @docusaurus/theme-search-algolia@2.0.0-beta.14 β”œβ”€ @docusaurus/theme-translations@2.0.0-beta.14 β”œβ”€ @docusaurus/utils-common@2.0.0-beta.14 β”œβ”€ @docusaurus/utils-validation@2.0.0-beta.14 └─ @docusaurus/utils@2.0.0-beta.14

Which Node.js version are you using?

v16.13.2

Which theme are you using?

Yes, I am using @docusaurus/theme-classic

How does your plugin config look like?

plugins: [
    [
      require.resolve("@cmfcmf/docusaurus-search-local"),
      {
        indexDocs: true,
      },
    ],
    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'core',
        path: 'core',
        routeBasePath: 'core',
        sidebarPath: undefined,
      },
    ],
    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'portal',
        path: 'portal',
        routeBasePath: 'portal',
        sidebarPath: undefined,
      }
    ],
    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'account-management',
        path: 'account-management',
        routeBasePath: 'account-management',
        sidebarPath: 'sidebarsAccount.js',
        // sidebarCollapsed: false,
      }
    ],
  ]

Additional context

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cmfcmfcommented, Mar 4, 2022

Thank you @slorber!

As for the original issue, please make sure to wrap your custom pages in <Layout> from @theme/layout, like you can see here: https://github.com/cmfcmf/docusaurus-search-local/blob/84c72c3d98c6e0d578c7799274f4a33a896c1425/packages/example-docs/src/pages/index.js#L31-L38

Please let me know if you continue to encounter this issue with the latest Docusaurus beta (v2.0.0-beta.17), then I’m happy to reopen this.

0reactions
slorbercommented, Mar 3, 2022

sorry missed the notification

I’m going to restore/duplicate those tags so that nobody is affected any more

Pages will be a bit heavier but not much πŸ€·β€β™‚οΈ not sure how to deal with this to make it convenient for most users and at the same time it doesn’t look great if you read algolia meta in third-party plugins

https://github.com/facebook/docusaurus/pull/6827

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't use yarn build command Β· Issue #109 - GitHub
Hello @ojkelly I recently migrate successfully my project from Yarn 1 to Yarn 3 After a yarn install which worked like a charm,...
Read more >
Error Codes | Yarn - Package Manager
This error means that this process failed and Yarn cannot successfully figure out which version of the package should be added to your...
Read more >
error Command failed with exit code 1. when I try to run yarn
Try executing following commands in your project root folder: yarn install and yarn start. In case if the above approach didn't help: Try...
Read more >
npm, pnpm, and Yarn | IntelliJ IDEA Documentation - JetBrains
Make sure you have Yarn 1 installed globally and enable Yarn 2 in your project as described on the Yarn official website. Use...
Read more >
Troubleshooting Node.js Deploys - Heroku Dev Center
Sometimes installing a dependency or running a build locally completes successfully, and when it gets to Heroku, the build will fail.
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