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

FlexSearch is broken when baseUrl contains URI with path #1275

Open
sivanov-nuodb opened this issue Aug 19, 2024 · 1 comment
Open

FlexSearch is broken when baseUrl contains URI with path #1275

sivanov-nuodb opened this issue Aug 19, 2024 · 1 comment

Comments

@sivanov-nuodb
Copy link

Description

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/
  1. 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
$ npm version
{
  'nuodb-cp-docs': '0.0.1',
  npm: '10.8.2',
  node: '22.6.0',
  acorn: '8.11.3',
  ada: '2.9.0',
  amaro: '0.0.6',
  ares: '1.32.3',
  brotli: '1.1.0',
  cjs_module_lexer: '1.2.2',
  cldr: '45.0',
  icu: '75.1',
  llhttp: '9.2.1',
  modules: '127',
  napi: '9',
  nbytes: '0.1.0',
  ncrypto: '0.0.1',
  nghttp2: '1.62.1',
  nghttp3: '0.7.0',
  ngtcp2: '1.3.0',
  openssl: '3.0.13+quic',
  simdjson: '3.9.4',
  simdutf: '5.3.0',
  sqlite: '3.46.0',
  tz: '2024a',
  undici: '6.19.2',
  unicode: '15.1',
  uv: '1.48.0',
  uvwasi: '0.0.21',
  v8: '12.4.254.21-node.18',
  zlib: '1.3.0.1-motley-209717d'
}
  "dependencies": {
    "@hyas/doks-core": "^1.6.1",
    "@hyas/images": "^3.2.0",
    "@hyas/inline-svg": "^1.1.0",
    "@hyas/seo": "^2.3.0",
    "@tabler/icons": "^3.2.0",
    "gethyas": "^2.4.2"
  },
@h-enk
Copy link
Member

h-enk commented Aug 20, 2024

Duplicate of thuliteio/doks-core#91

To be fixed — solution: #1207 (reply in thread)

PR on thuliteio/doks-core is welcome 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants