docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

Docusaurus v3 Support

Open bahadirarslan opened this issue 9 months ago • 17 comments

Docusaurus has been updated to v3 recently, but this package doesn't support it yet.

Are you planning to update this package to support v3? We would appreciate it if you will.

bahadirarslan avatar Apr 25 '24 20:04 bahadirarslan

Workaround: https://github.com/cmfcmf/docusaurus-search-local/issues/199#issuecomment-1901928218

PR waiting to get merged https://github.com/cmfcmf/docusaurus-search-local/pull/204

I'm not sure if @cmfcmf has abandoned this project.

HLeithner avatar Apr 26 '24 09:04 HLeithner

Workaround: #199 (comment)

PR waiting to get merged #204

I'm not sure if @cmfcmf has abandoned this project.

Thank you, this was helped. But I also needed to add @docusaurus/theme-common as dependency. This was not mentioned anywhere but the build threw an exception because of this missing dependency. Anyway, now it works like a charm.

bahadirarslan avatar Apr 26 '24 21:04 bahadirarslan

I'm not sure if @cmfcmf has abandoned this project.

Unfortunately, I did not find enough time to work on this project over the last few months, but I hope to get back to it some time this week to at least make sure that Docusaurus 3 compatibility is tested and working. Sorry everyone for the wait 😓

cmfcmf avatar Apr 29 '24 07:04 cmfcmf

I'm not sure if @cmfcmf has abandoned this project.

Unfortunately, I did not find enough time to work on this project over the last few months, but I hope to get back to it some time this week to at least make sure that Docusaurus 3 compatibility is tested and working. Sorry everyone for the wait 😓

Don't worry, take the time you need and of course thanks for your work on this project.

HLeithner avatar Apr 29 '24 07:04 HLeithner

@cmfcmf thanks for working on this! Do you have any indication of an ETA for when this plugin might become compatible with Docusaurus v3?

apotecbec avatar Jun 06 '24 15:06 apotecbec

I made some progress today and merged a few changes for Docusaurus v2, as well as updated the GitHub Actions workflow to test on the latest Node.js and Docusaurus v2.x versions.

Unfortunately, I did not get to adding support for Docusaurus v3 today. The PR (https://github.com/cmfcmf/docusaurus-search-local/pull/204) is currently missing at least a) an update of the GitHub Actions workflow file to test with Docusaurus v3 as well b) an update of packages/example-docs to Docusaurus v3 (even better if we can have one example docs for v2 and one for v3) c) raising the minimum Node.js version to 18. If anyone would like to help with that, so I can release a new version of this plugin that is compatible with Docusaurus v3, please go ahead and send a PR (or coordinate with @fooku18 to update their PR).

Otherwise I hope to get to this next weekend.

cmfcmf avatar Jun 09 '24 16:06 cmfcmf

When using the search plugin (v1.2.0) on Docusaurus v3.4 and v3.3.2, incorrect URLs are being generated while accessing the level 2 topics from the search results.

URL error: {url}/docs/filename/docs/filename#level2topic

Whereas on a new Docusaurus site (neither versioned nor contains multiple docs) the search capability works in v3.3.2 but yields incorrect URLs in v3.4.

nanditha938 avatar Jun 19 '24 15:06 nanditha938

I encountered a similar problem after upgrading to v1.2.0 with Docusaurus v3.4; the search results seem to be double appearing at times, and providing incorrect URLs.

fartbagxp avatar Jun 21 '24 15:06 fartbagxp

I am having the same problem, with the only difference being, that even after reverting to v3.3.2 in the main and overwrite, the issue still persists.

I will look forward to any updates on this thread 👍

Pyenb avatar Jun 21 '24 23:06 Pyenb

I am having the same problem, with the only difference being, that even after reverting to v3.3.2 in the main and overwrite, the issue still persists.

I will look forward to any updates on this thread 👍

You can downgrade to cmfcmf/docusaurus-search-local to v1.1.0 and keep docusaurus v3.4.0.

fartbagxp avatar Jun 22 '24 03:06 fartbagxp

I am having the same problem, with the only difference being, that even after reverting to v3.3.2 in the main and overwrite, the issue still persists. I will look forward to any updates on this thread 👍

You can downgrade to cmfcmf/docusaurus-search-local to v1.1.0 and keep docusaurus v3.4.0.

I did, but the issue still seems to be present. Or did I do something wrong?

here are my dependencies:

  "dependencies": {
    "@cmfcmf/docusaurus-search-local": "1.1.0",
    "@docusaurus/core": "^3.4.0",
    "@docusaurus/plugin-client-redirects": "^3.4.0",
    "@docusaurus/preset-classic": "^3.4.0",
    "axios": "^1.7.2",
    "clsx": "^2.1.1",
    "express": "^4.19.2",
    "prism-react-renderer": "^2.3.1",
    "react": "^18.3.1",
    "react-dom": "^18.3.1"
  },
  "devDependencies": {
    "@docusaurus/module-type-aliases": "^3.4.0"
  },

EDIT: I removed the "^" from all the docusaurus dependencies, as not update them to the next minor version and now everything is back up working again. Thanks everyone for the help 👍

Pyenb avatar Jun 22 '24 07:06 Pyenb

I exercised all suggested solutions, including running different builds and dependencies. However, the issue persists on all of them.

Somehow the /blog/ urls showcased in the search dropdown menu are generated correctly, the /doc/ ones are now.

MoonchainMaxi avatar Jun 24 '24 11:06 MoonchainMaxi

hey @cmfcmf, thank you for continuing to work on this. How are things going with the Docusaurus v3 compatibility? If you have a rough ETA you could share, that would be most helpful to know.

apotecbec avatar Jun 26 '24 12:06 apotecbec

I exercised all suggested solutions, including running different builds and dependencies. However, the issue persists on all of them.

Can confirm the same issue, had to downgrade Docusaurus to v3.3.2 to get search working again.

Ueland avatar Jul 02 '24 07:07 Ueland

is there a pull request for this ?

sibelius avatar Jul 07 '24 22:07 sibelius

Note: I reverted the Docusaurus v3.4 change to unbreak local search plugins in v3.5.

Related to:

  • https://github.com/cmfcmf/docusaurus-search-local/issues/214
  • https://github.com/facebook/docusaurus/pull/10311
  • https://github.com/gabrielcsapo/docusaurus-plugin-search-local/issues/82

But v3.5 has another issue, please wait until I publish v3.5.2 with a fix for https://github.com/cmfcmf/docusaurus-search-local/issues/217

slorber avatar Aug 12 '24 15:08 slorber

Docusaurus v3.5.2 has been released and should work fine with this plugin (I tried with v1.2)


Note: you may get another error while building your site.

[ERROR] Error: Unable to build website for locale en.
  ...
  [cause]: TypeError: Cannot read properties of undefined (reading 'load')
      at getDocusaurusTag (.../@cmfcmf/docusaurus-search-local/lib/server/parse.js:194:33)
      at .../@cmfcmf/docusaurus-search-local/lib/server/index.js:288:60

It is a different issue, related to a recent release of Cheerio v1.0 that did unexpected breaking changes. See my PR for details and workarounds: https://github.com/cmfcmf/docusaurus-search-local/pull/218

slorber avatar Aug 13 '24 12:08 slorber