sitespeedio / sitespeedio/sitespeed.io

Can sitespeed measure nav loads in child iframes?

Open
#4,026 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

awaiting response
Dominant language
JavaScript
Stars
5k
Forks
624
Avg merge
4h 8m
Merged PRs (30d)
2

Description

Have you read the documentation?
URL

localhost

What are you trying to accomplish

One of our sites has content in an iframe, part of which are links to load content in another, child iframe. When I try to measure this however, sitespeed.io crashes with the below error output. If I comment the stop() and start("Open Documents") calls, to group this measurement in with the last one, sitespeed proceeds without a problem.

Does this sound like we are too far outside the use case for sitespeed.io, or is there some other things we can try?

Cheers.

What browser did you use?

Chrome

How to reproduce
await commands.wait.bySelector("#iframe1")
    await commands.switch.toFrame('iframe1');
    await commands.wait.bySelector("#iframe2)
    await commands.switch.toFrame('iframe2');

    // Just wait so we dont have to deal with not loaded problems just now
    await commands.wait.byTime(30000)
 
    await commands.measure.stop();

    await commands.measure.start("Open Documents")
commands.click.byJsAndWait(`document.getElementById("linksTree").querySelectorAll("div[id*=links]")[2]`)

    await commands.measure.stop()
    await commands.switch.toParentFrame()
    await commands.switch.toParentFrame()
Log output
ERROR: Could not generate url/summary/index, /Users/douglascl/.nvm/versions/node/v18.16.0/lib/node_modules/sitespeed.io/lib/plugins/html/templates/url/thirdparty/index.pug:24
    22| h2 Third party
    23|
  > 24| - const thirdPartyWebVersion = pageInfo.data.coach.run ? pageInfo.data.coach.run.thirdPartyWebVersion : pageInfo.data.coach.pageSummary.thirdPartyWebVersion;
    25| p Third party requests categorised by
    26|     a(href='https://github.com/patrickhulce/third-party-web') Third party web
    27|     |  version #{thirdPartyWebVersion}.

Cannot read properties of undefined (reading 'run')
[2023-12-01 11:46:42] ERROR: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
    at writeFile (node:fs:2196:5)
    at node:internal/util:375:7
    at new Promise (<anonymous>)
    at writeFile (node:internal/util:361:12)
    at write (file:///Users/douglascl/.nvm/versions/node/v18.16.0/lib/node_modules/sitespeed.io/lib/core/resultsStorage/storageManager.js:26:10)
    at file:///Users/douglascl/.nvm/versions/node/v18.16.0/lib/node_modules/sitespeed.io/lib/core/resultsStorage/storageManager.js:113:9
    at async HTMLBuilder.render (file:///Users/douglascl/.nvm/versions/node/v18.16.0/lib/node_modules/sitespeed.io/lib/plugins/html/htmlBuilder.js:340:7)
Errors while running:
Rejected {
  "uuid": "5906fa65-00e3-4121-82f7-c054a80a1537",
  "type": "sitespeedio.render",
  "timestamp": "2023-12-01T11:46:41+13:00",
  "source": "queueHandler",
  "data": "{...}"
} for plugin: html
{"code":"ERR_INVALID_ARG_TYPE"}
Error: Errors while running:
Rejected {
  "uuid": "5906fa65-00e3-4121-82f7-c054a80a1537",
  "type": "sitespeedio.render",
  "timestamp": "2023-12-01T11:46:41+13:00",
  "source": "queueHandler",
  "data": "{...}"
} for plugin: html
{"code":"ERR_INVALID_ARG_TYPE"}
    at start (file:///Users/douglascl/.nvm/versions/node/v18.16.0/lib/node_modules/sitespeed.io/bin/sitespeed.js:167:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///Users/douglascl/.nvm/versions/node/v18.16.0/lib/node_modules/sitespeed.io/bin/sitespeed.js:178:1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the nested-iframe reproduction and the error in lib/plugins/html/templates/url/thirdparty/index.pug, then trace the related rendering flow through lib/plugins/html/htmlBuilder.js and storageManager.js. Reproduce the stop/start measurement sequence and verify that the HTML report renders without the undefined coach data error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.