Bug
(issue initially discovered by @haiqi96 )
The client application can only be served from the website root (/) because Vite's configuration is missing the base parameter that needs to be set to "./". This prevents the app from being hosted in any subdirectory or non-root path.
When attempting to serve the application from a path other than the root, the app fails to load assets correctly, resulting in 404 errors for scripts, stylesheets, and other resources; depending on the hosting environment, the response may even be routed to a different application which gives 200 and causes confusion in debugging. This occurs because all asset URLs are generated as absolute paths from the root instead of relative paths.
CLP version
faddfc3
Environment
Chrome
Version 135.0.7049.115
Reproduction steps
- Build the client application:
cd components/log-viewer-webui/client
npm install
npm run build
- Observe the assets were generated under
dist.
- Serve the application using a simple HTTP server with a path prefix:
- Open your browser and navigate to http://localhost:8080/dist/index.html
- Open the browser debugger and observe the
index.html loads but individual resources fail to load with 404 errors: Browser console shows errors for missing JavaScript and CSS files.
- Inspect the
index.html source and note that all asset URLs are absolute paths (e.g., /assets/main.js) instead of relative paths (./assets/main.js)
Bug
(issue initially discovered by @haiqi96 )
The client application can only be served from the website root (/) because Vite's configuration is missing the
baseparameter that needs to be set to "./". This prevents the app from being hosted in any subdirectory or non-root path.When attempting to serve the application from a path other than the root, the app fails to load assets correctly, resulting in 404 errors for scripts, stylesheets, and other resources; depending on the hosting environment, the response may even be routed to a different application which gives 200 and causes confusion in debugging. This occurs because all asset URLs are generated as absolute paths from the root instead of relative paths.
CLP version
faddfc3
Environment
Chrome
Version 135.0.7049.115
Reproduction steps
dist.index.htmlloads but individual resources fail to load with 404 errors: Browser console shows errors for missing JavaScript and CSS files.index.htmlsource and note that all asset URLs are absolute paths (e.g., /assets/main.js) instead of relative paths (./assets/main.js)