Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in search in mandarin config throw error #1102

Open
riccox opened this issue Nov 23, 2024 · 1 comment
Open

Built-in search in mandarin config throw error #1102

riccox opened this issue Nov 23, 2024 · 1 comment
Labels
bug Something isn't working upstream

Comments

@riccox
Copy link

riccox commented Nov 23, 2024

To Reproduce

  1. use latest auto start template to create a docs project.
  2. config mandarin search by this steps in docs.
  3. start dev server
  4. enter some words input search input.
  5. see dev server output.

Current vs. Expected behavior

throw orama tokenizer type error, and without any search results.

node_modules/fumadocs-core/node_modules/@orama/orama/dist/esm/components/index.js (130:1) @ eval
TypeError: tokens is not iterable
    at eval (./app/api/search/route.ts:17:94)
  128 |                 const tokens = tokenizer.tokenize(value, language, prop, false);
  129 |                 implementation.insertDocumentScoreParameters(index, prop, internalId, tokens, docsCount);
> 130 |                 for (const token of tokens) {
      | ^
  131 |                     implementation.insertTokenScoreParameters(index, prop, internalId, tokens, token);
  132 |                     node.insert(token, internalId);
  133 |                 }

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:02:45 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8112
  Available memory (MB): 24576
  Available CPU cores: 8
Binaries:
  Node: 20.17.0
  npm: 10.8.2
  Yarn: N/A
  pnpm: 9.12.3
Relevant Packages:
  next: 15.0.3 // Latest available version is detected (15.0.3).
  eslint-config-next: 15.0.3
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.7.2

Which area(s) are affected? (Select all that apply)

Core

Additional context

No response

@riccox riccox added the bug Something isn't working label Nov 23, 2024
@fuma-nama
Copy link
Owner

I found that it's a upstream problem caused by invoking tokenizer.tokenize without await, they made insert methods sync but it's not compatible with tokenizer, will report it to Orama later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

2 participants