typesense / typesense/docusaurus-theme-search-typesense

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map')

Open
#29 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
84
Forks
24
Avg merge
1m
Merged PRs (30d)
1

Description

Description

Hello,

I am a brand new TypeSense user. I am trying to move my existing Docusaurus website from Algolia --> TypeSense. I followed the steps from the documentation, and I cannot get it working.

My Docusaurus site is published to: https://isaacscript.github.io/

When attempting to type anything into the search, I get the following error in the JavaScript console:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map')
    at t.value (37702.a034fb89.js:2:3949)
    at t.value (37702.a034fb89.js:2:8672)
    at 90888.529c7e8f.js:1:56429
    at p (37702.a034fb89.js:2:105125)
    at Generator.<anonymous> (37702.a034fb89.js:2:106462)
    at Generator.next (37702.a034fb89.js:2:105488)
    at jt (90888.529c7e8f.js:1:55241)
    at i (90888.529c7e8f.js:1:56585)

More Info

I am self-hosting TypeSense. I can see what the version is from the log file:

I20230208 07:07:05.562175 480505 typesense_server_utils.cpp:357] Starting Typesense 0.24.0

My "typesense-server.ini" looks like this:

; Typesense Configuration

[server]

api-address = 0.0.0.0
api-port = 8108
data-dir = /var/lib/typesense
api-key = 9AiKF0AGD145wC9fc4NafATcCam89XT7v2NxGf2ymFucN7b6
log-dir = /var/log/typesense

And the config in my "docusaurus.config.js" file is this:

      typesense: {
        typesenseCollectionName: "isaacscript",
        typesenseServerConfig: {
          nodes: [
            {
              host: "isaacracing.net",
              port: 8108,
              protocol: "https",
            },
          ],
          apiKey: "9AiKF0AGD145wC9fc4NafATcCam89XT7v2NxGf2ymFucN7b6",
        },

        typesenseSearchParameters: {},

        contextualSearch: true,
      },

For reference, the "docusaurus.config.js" file is located here:
https://github.com/IsaacScript/isaacscript/blob/main/packages/docs/docusaurus.config.js

Furthermore, I am using the following version of the plugin, which is located in my "package.json" file:

    "docusaurus-theme-search-typesense": "^0.9.0",

For reference, the "package.json" file is located here:
https://github.com/IsaacScript/isaacscript/blob/main/package.json

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by using the search on the reported Docusaurus site, then inspect packages/docs/docusaurus.config.js and package.json for the search configuration and plugin version. Trace the plugin's search request from that configuration and verify that typing a query completes without the TypeError and returns results.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.