cmfcmf / docusaurus-search-local

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

Docusaurus v3 Support #205

Open bahadirarslan opened 3 months ago

bahadirarslan commented 3 months ago

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.

HLeithner commented 3 months ago

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.

bahadirarslan commented 3 months ago

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.

cmfcmf commented 3 months ago

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 😓

HLeithner commented 3 months ago

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.

apotecbec commented 2 months ago

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

cmfcmf commented 2 months ago

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.

nanditha938 commented 1 month ago

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.

fartbagxp commented 1 month ago

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.

Pyenb commented 1 month ago

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 👍

fartbagxp commented 1 month ago

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.

Pyenb commented 1 month ago

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 👍

MoonchainMaxi commented 1 month ago

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.

apotecbec commented 1 month ago

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.

Ueland commented 1 month ago

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.

sibelius commented 1 month ago

is there a pull request for this ?

slorber commented 3 days ago

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

Related to:

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 commented 2 days ago

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