Have you read the documentation?
URL
Any generated local HTML report page summary URL.
What are you trying to accomplish
Open a generated page summary report and view the waterfall/screenshots reliably regardless of whether the URL is opened as /dir, /dir/ or /dir/index.html.
What browser did you use?
Chrome
How to reproduce
Generate a report for a page whose summary is stored at something like:
pages/example_com/path/index.html
Serve the report over HTTP and open the page summary in these two ways:
- broken:
http://localhost:3000/pages/example_com/path
- works:
http://localhost:3000/pages/example_com/path/
- works:
http://localhost:3000/pages/example_com/path/index.html
Actual result
When opened without the trailing slash, the generated page resolves relative paths against the parent path.
The HTML uses relative paths like:
data/browsertime.har.gz
data/screenshots/...
./1.html
metrics.html
So the browser requests the wrong URLs, for example:
http://localhost:3000/pages/example_com/data/browsertime.har.gz
http://localhost:3000/pages/example_com/data/screenshots/1/afterPageCompleteCheck.jpg
instead of:
http://localhost:3000/pages/example_com/path/data/browsertime.har.gz
http://localhost:3000/pages/example_com/path/data/screenshots/1/afterPageCompleteCheck.jpg
This causes 404s for HAR/screenshots and the waterfall never loads.
Console output looks like:
GET http://localhost:3000/pages/example_com/data/browsertime.har.gz 404 (Not Found)
GET http://localhost:3000/pages/example_com/data/screenshots/1/afterPageCompleteCheck.jpg 404 (Not Found)
Error: invalid file signature:60,33
60,33 is <!, so the waterfall code appears to be trying to gunzip an HTML 404 page.
Expected result
The generated report should work regardless of whether the page is opened as:
/dir
/dir/
/dir/index.html
or at least fail with a clear error instead of spinning forever.
Notes
I checked the latest npm package too (39.5.0) and the HTML templates still appear to use the same relative paths in the waterfall/page summary templates, and I did not see a <base> tag added for per-page summaries.
Possible fix
Any of these would likely fix it:
- Add a
<base href=".../"> tag to generated per-page HTML.
- Use explicit
/index.html consistently in generated/opened URLs.
- Add
.catch(...) around HAR fetch/decompression so the UI shows a real error instead of infinite loading.
Have you read the documentation?
URL
Any generated local HTML report page summary URL.
What are you trying to accomplish
Open a generated page summary report and view the waterfall/screenshots reliably regardless of whether the URL is opened as
/dir,/dir/or/dir/index.html.What browser did you use?
Chrome
How to reproduce
Generate a report for a page whose summary is stored at something like:
pages/example_com/path/index.htmlServe the report over HTTP and open the page summary in these two ways:
http://localhost:3000/pages/example_com/pathhttp://localhost:3000/pages/example_com/path/http://localhost:3000/pages/example_com/path/index.htmlActual result
When opened without the trailing slash, the generated page resolves relative paths against the parent path.
The HTML uses relative paths like:
data/browsertime.har.gzdata/screenshots/..../1.htmlmetrics.htmlSo the browser requests the wrong URLs, for example:
http://localhost:3000/pages/example_com/data/browsertime.har.gzhttp://localhost:3000/pages/example_com/data/screenshots/1/afterPageCompleteCheck.jpginstead of:
http://localhost:3000/pages/example_com/path/data/browsertime.har.gzhttp://localhost:3000/pages/example_com/path/data/screenshots/1/afterPageCompleteCheck.jpgThis causes 404s for HAR/screenshots and the waterfall never loads.
Console output looks like:
60,33is<!, so the waterfall code appears to be trying to gunzip an HTML 404 page.Expected result
The generated report should work regardless of whether the page is opened as:
/dir/dir//dir/index.htmlor at least fail with a clear error instead of spinning forever.
Notes
I checked the latest npm package too (
39.5.0) and the HTML templates still appear to use the same relative paths in the waterfall/page summary templates, and I did not see a<base>tag added for per-page summaries.Possible fix
Any of these would likely fix it:
<base href=".../">tag to generated per-page HTML./index.htmlconsistently in generated/opened URLs..catch(...)around HAR fetch/decompression so the UI shows a real error instead of infinite loading.