orama icon indicating copy to clipboard operation
orama copied to clipboard

Docusaurus V3 plugin not working on fresh install

Open dusanbobicic opened this issue 1 year ago • 10 comments

Describe the bug

First we tried integrating the OSS version of the plugin on the existing solution instead of lunr search plugin but we got an error. To verify that the issue is with the orama plugin we've tried on a fresh docusaurus project and it did not work. We are getting some react errors. See the image below: image

Error link

When we run the website in development mode using: npm run start We get a following error which describes more the minified issue:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `OramaSearchWithDocs`.

Thanks for taking your time!

To Reproduce

  1. Initialize fresh docusaurus project. It will create a docusaurus 3.4.0 site
  2. Build the website, to verify that docusaurus works. It works.
  3. Clear the build and cache folders
  4. Install orama docusaurus V3 plugin
  5. Add the plugin to docusaurus.config.ts
  6. Run npm run build
  7. Run npm run serve

Expected behavior

Site is built and docusaurus website is rendered with search box.

Environment Info

OS: Windows 11
Node: v20.10.0
Orama Plugin Version: 2.0.19
Docusaurus: 3.4.0

Affected areas

Initialization, Search

Additional context

No response

dusanbobicic avatar Jun 03 '24 12:06 dusanbobicic

@dusanbobicic hopefully a fix gets pushed soon, but I got it to work with npm run swizzle.

I was able to get orama working with docusaurus 3.4.0, by using npm swizzle and ejecting: and then i updated @orama/searchbox, and then setting @orama/searchbox in my package.json to an older version at 1.0.0-rc33

Screenshot 2024-06-06 at 2 57 43 PM

avb-is-me avatar Jun 06 '24 18:06 avb-is-me

I also tried a fresh OSS install on MacOS and got this error, Error: ENOENT: no such file or directory, open ... /.docusaurus/orama-search-index-current.json.gz

Also the docs are lacking on how to integrate frontend SDKs like orama/searchbar

dezlitz avatar Jul 10 '24 23:07 dezlitz

@madlitz I got the same error Error: ENOENT: no such file or directory, open ... /.docusaurus/orama-search-index-current.json.gz

To reproduce

Inside docusaurus exising project install:

yarn add @orama/plugin-docusaurus-v3

in docusaurus.config.js file: { // ... plugins: ["@orama/plugin-docusaurus-v3"], // ... } After these steps, yarn build command doesn't work. Anyone know what's wrong? Thanks

sergiocastro95 avatar Jul 11 '24 15:07 sergiocastro95

Is there any news or new version that fixes this issue?

thinkh avatar Jul 17 '24 07:07 thinkh

About the missing index.gz, I think the problem is here:

https://github.com/askorama/orama/pull/740/files#diff-1e5bb5e22e25889194584b9af13cb63f027762f1519cc0bf3c4b21ca15f6b866L56

ShogunPanda avatar Jul 19 '24 10:07 ShogunPanda

Can confirm this is now fixed as of 2.0.20. Edit: Whoops, not really!

The docs don't say it specifically but you need to run:

npm run build first ... then npm run start or npm run serve

The only bug I could see is that search results are not returning fragments which I have raised an issue #751

Oh and the "ask AI" field should not be there for the OSS version I assume.

dezlitz avatar Jul 24 '24 12:07 dezlitz

I still get the Error: ENOENT: no such file or directory, open ... /.docusaurus/orama-search-index-current.json.gz

Docusaurus: 3.4.0
Orama plugin: 2.0.22

I use yarn and it's not a fresh install. I tried to build first, but it still shows that error while bulding. What am I doing wrong and how can I fix that?

UPD Tried with a fresh install, still doesn't work.

LevGolumov avatar Jul 27 '24 09:07 LevGolumov

@LevGolumov Yeah when I said I confirmed it was fixed I accidentally left in a modified version of the file. I have the working fix in the PR above.

dezlitz avatar Jul 27 '24 10:07 dezlitz

Also I removed the 'Orama AI' section with this css in my project:

div[class^="ShowSummaryCTA"] {
  display: none !important;
}

But it would be nice for the plugin to do this automatically. Unfortunately it looks like @orama/searchbox frontend code isn't included in this repo. I can only find the npm package that has already been minified.

dezlitz avatar Jul 27 '24 10:07 dezlitz

Hit this while searching for an offline search plugin for Docusaurus... :(

segevfiner avatar Aug 12 '24 15:08 segevfiner

I'm also getting this Error: ENOENT: no such file or directory, open ... /.docusaurus/orama-search-index-current.json.gz when I'm trying to use the plugin.

jeevanjoseph avatar Aug 28 '24 16:08 jeevanjoseph