FlexSearch is broken when the baseUrl contains a path in the URI (e.g. http://localhost:8080/nuodb-cp-docs/). The search-index.json is still requested from the incorrect base path.
Steps to reproduce
1 . Build the site
rm -rf public tmp/public
npm run build -- --baseURL http://localhost:8080/nuodb-cp-docs/
Serve the generated site
cp public tmp/nuodb-cp-docs
cd tmp && http-server
Navigate to http://localhost:8080/nuodb-cp-docs/ in the browser and try to search.
The below log shows the 404 errors preventing search from working.
[Mon Aug 19 2024 18:07:31 GMT+0300 (Eastern European Summer Time)] "GET /search-index.json" Error (404): "Not found"
[Mon Aug 19 2024 18:07:31 GMT+0300 (Eastern European Summer Time)] "GET /favicon-192x192.png" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"
[Mon Aug 19 2024 18:07:31 GMT+0300 (Eastern European Summer Time)] "GET /favicon-192x192.png" Error (404): "Not found"
Expected result
I'm expecting to see GET /nuodb-cp-docs/search-index.json.
Actual result
Search is broken and 404 error is returned.
Environment
$ hugo version
hugo v0.132.1+extended darwin/amd64 BuildDate=2024-08-13T10:10:10Z VendorInfo=brew
Description
FlexSearch is broken when the
baseUrl
contains a path in the URI (e.g.http://localhost:8080/nuodb-cp-docs/
). Thesearch-index.json
is still requested from the incorrect base path.Steps to reproduce
1 . Build the site
Navigate to
http://localhost:8080/nuodb-cp-docs/
in the browser and try to search. The below log shows the 404 errors preventing search from working.Expected result
I'm expecting to see
GET /nuodb-cp-docs/search-index.json
.Actual result
Search is broken and 404 error is returned.
Environment