Hello. I'm giving TypeSense a test-drive with my D...
# community-help
j
Hello. I'm giving TypeSense a test-drive with my Docusaurus website. However, after following all of the installation instructions, I'm getting this weird behavior (see screenshot). Any idea of what might be wrong or where to start troubleshooting? For reference, my site is: https://isaacscript.github.io/
k
Can you check the browser console / network tab to see what request is being sent?
j
Oh, that's tipping me off to the error. I guess I can't mix HTTP and HTTPS.
When I try to upgrade to HTTPS, I get the following error in the log:
Copy code
E20230208 07:07:05.617331 480505 http_server.cpp:1065] An error occurred while trying to load server certificate file: "/etc/letsencrypt/live/isaacracing.net/fullchain.pem"
That file certainly exists, and is being used by my existing HTTP website.
k
Check the pem file permissions
j
Copy code
root@zamiel-vps:~/typesense# ls -l /etc/letsencrypt/live/isaacracing.net/fullchain.pem
lrwxrwxrwx 1 root root 44 Feb  2 15:55 /etc/letsencrypt/live/isaacracing.net/fullchain.pem -> ../../archive/isaacracing.net/fullchain3.pem
root@zamiel-vps:~/typesense# ls -l /etc/letsencrypt/archive/isaacracing.net/fullchain3.pem
-rw-r--r-- 1 root root 5620 Feb  2 15:55 /etc/letsencrypt/archive/isaacracing.net/fullchain3.pem
It has world-read, so that shouldn't be an issue.
This is just a pretty ordinary Lets Encrypt certificate.
k
Try giving direct path instead of the symlink?
j
Ok, I think I figured it out. I was using quotes, and apparently the ini parser barfs if you use quotes.
k
🤔 Oh wow TIL
j
Using an ini file is a pretty weird choice for a service like this. I'm surprised something more standard wasn't chosen, like JSON or YAML or TOML.
For example, TOML doesn't have this quote limitation.
k
JSON is too verbose, YAML white space sensitivity is really painful when generating config files from code, TOML is not very popular. INI seemed the easiest of the lot and lot of other linux utilities use it, but yeah it's a bit old school.
j
message has been deleted
I was able to sort out the SSL error, but now I'm getting this. Any ideas?
You can see it for yourself if you surf to: https://isaacscript.github.io/ And then start typing in the search bar.
k
Wait, that's a build issue, not a runtime error.
Can you post the version you are using?
j
My package.json file contains the following:
Copy code
"docusaurus-theme-search-typesense": "^0.9.0",
k
Ok I will have to refer this to @Jason Bosco
j
@James Nesta It looks like the index may be missing. Could you run the scraper again and let me know?
j
@Jason Bosco Thanks. I managed to solve the issue - I had the collection name wrong in my "docusaurus.config.js" file. Two suggestions to ease the pain for new users: 1. When you run the scraper for the first time, it automatically chooses an arbitrary collection name. In my case, it was "docusaurus-2_1675838072". I think that the tool should explicitly pause and tell you to write this down, or possibly prompt the user for their desired collection name. In my case, it would have been nice to name it "isaacscript" to correspond to the URL, but I guess I'll just keep the auto-generated collection name for now. Anyways, the reason that I bring this up is because I had to retroactively find out what the name of the collection was by pouring through the log files - not a great user experience. 2. The run time error was extremely unhelpful. Can we increase DX by making that better? A more-specific message in the JavaScript console would go a long way, like something along the lines of:
Copy code
Failed to query the remote collection of "foo". Make sure that the configured collection name matches what is actually present on the remote Typesense server.