cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
438 stars 67 forks source link

[ERROR] Error: docusaurus_tag meta tag not found #102

Closed spham closed 2 years ago

spham commented 2 years ago

Please describe the bug you are seeing

[ERROR] Unable to build website for locale en. [ERROR] Error: docusaurus_tag meta tag not found. This is a bug and should never happen.

How can we best reproduce the bug?

npx create-docusaurus@latest testdoc classic

add this follow

 plugins: [
    [
      require.resolve("@cmfcmf/docusaurus-search-local"),
      {
        language: "fr",
      }
    ],
  ],

npm run build

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

├─┬ @cmfcmf/docusaurus-search-local@0.10.0
│ └── @docusaurus/core@2.0.0-beta.16 deduped
├── @docusaurus/core@2.0.0-beta.16
└─┬ @docusaurus/preset-classic@2.0.0-beta.16
  ├── @docusaurus/core@2.0.0-beta.16 deduped
  ├─┬ @docusaurus/plugin-content-blog@2.0.0-beta.16
  │ └── @docusaurus/core@2.0.0-beta.16 deduped
  ├─┬ @docusaurus/plugin-content-docs@2.0.0-beta.16
  │ └── @docusaurus/core@2.0.0-beta.16 deduped
  ├─┬ @docusaurus/plugin-content-pages@2.0.0-beta.16
  │ └── @docusaurus/core@2.0.0-beta.16 deduped
  ├─┬ @docusaurus/plugin-debug@2.0.0-beta.16
  │ └── @docusaurus/core@2.0.0-beta.16 deduped
  ├─┬ @docusaurus/plugin-google-analytics@2.0.0-beta.16
  │ └── @docusaurus/core@2.0.0-beta.16 deduped
  ├─┬ @docusaurus/plugin-google-gtag@2.0.0-beta.16
  │ └── @docusaurus/core@2.0.0-beta.16 deduped
  ├─┬ @docusaurus/plugin-sitemap@2.0.0-beta.16
  │ └── @docusaurus/core@2.0.0-beta.16 deduped
  ├─┬ @docusaurus/theme-classic@2.0.0-beta.16
  │ └── @docusaurus/core@2.0.0-beta.16 deduped
  └─┬ @docusaurus/theme-search-algolia@2.0.0-beta.16
    └── @docusaurus/core@2.0.0-beta.16 deduped

Which Node.js version are you using?

v16.3.0

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"),
      {
        language: "fr",
      }
    ],
  ],

Additional context

wsl on local or gitlab ci failed

image: node:15.12-alpine3.13

before_script:
  - node -v
  - cat /etc/*release
  - yarn -v

stages:
  - test
  - deploy

pages:
  stage: deploy
  script:
    - npm install --force
    - npm run build
    - mv ./build ./public
  artifacts:
    paths:
    - public
  # only:
  #   - pages
Danielku15 commented 2 years ago

Just stumbled over the same error today, but I'm using a the canary build 0.0.0.4639 currently. Seems they changed the tag from <meta data-rh="true" name="docusaurus_tag" to <meta data-rh="true" name="docsearch:docusaurus_tag" just lately: https://github.com/facebook/docusaurus/commit/a6f53aa9d2c2172fcc7bb017c8226614885f7972

Following code will need update:

https://github.com/cmfcmf/docusaurus-search-local/blob/bd9424f7ec8113ac1d6bbf01af6732af273e47ee/packages/docusaurus-search-local/src/server/parse.ts#L204-L213

Maybe the selector could be changed to meta[name*="docusaurus_tag"] (contains) or meta[name=$="docusaurus_tag"] (ends-with) to ensure compatibility with multiple versions?

JacobWeisenburger commented 2 years ago

Same here

[ERROR] Unable to build website for locale en.
[ERROR] Error: docusaurus_tag meta tag not found. This is a bug and should never happen.
cmfcmf commented 2 years ago

Thank you everyone for reporting this issue. Docusaurus reverted the name of the metatag in https://github.com/facebook/docusaurus/pull/6827, which was released as part of v2.0.0-beta.17 and I'll also release a new version of this plugin that is tested with the latest Docusaurus beta today.