sitespeedio / sitespeedio/sitespeed.io
ERROR: TypeError: commands.breakpoint is not a function
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5k
- Forks
- 624
- Avg merge
- 4h 8m
- Merged PRs (30d)
- 2
Description
Have you read the documentation?
- Yes, I've read the how to make a reproducable bug guide
- Yes, I've read the how to debug my script guide
URL
What are you trying to accomplish
following this to try and debug a line in a script.
What browser did you use?
Chrome (Version 123.0.6312.122 (Official Build) (arm64-- Mac M2))
How to reproduce
script:
/**
* @param {import('browsertime').BrowsertimeContext} context
* @param {import('browsertime').BrowsertimeCommands} commands
*/
export default async function (context, commands) {
await commands.measure.start('https://whatever.com');
await commands.breakpoint('');
};
run with (I'm on Versions OS: darwin 23.0.0 nodejs: v16.20.0 sitespeed.io: 33.5.0 browsertime: 21.7.0 coach: 8.0.2):
sitespeed.io --multi scripts/index.mjs -n 1 --debug
Log output
❯ sitespeed.io --multi scripts/index.mjs -n 1 --debug
[2024-04-16 12:20:47] INFO: Versions OS: darwin 23.0.0 nodejs: v16.20.0 sitespeed.io: 33.5.0 browsertime: 21.7.0 coach: 8.0.2
[2024-04-16 12:20:47] INFO: Running tests using Chrome - 1 iteration(s)
[2024-04-16 12:20:49] INFO: Testing url https://whatever.com iteration 1
[2024-04-16 12:20:55] INFO: Take after page complete check screenshot
[2024-04-16 12:20:56] INFO: Take cumulative layout shift screenshot
[2024-04-16 12:20:57] INFO: Take largest contentful paint screenshot
[2024-04-16 12:20:59] INFO: Mark run as failure with message: commands.breakpoint is not a function
[2024-04-16 12:20:59] ERROR: TypeError: commands.breakpoint is not a function
at default (file:///Users/me/workspace/sitespeed/scripts/index.mjs:22:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async file:///Users/me/.nvm/versions/node/v16.20.0/lib/node_modules/sitespeed.io/node_modules/browsertime/lib/core/engine/run.js:4:7
at async Iteration.run (file:///Users/me/.nvm/versions/node/v16.20.0/lib/node_modules/sitespeed.io/node_modules/browsertime/lib/core/engine/iteration.js:162:9)
at async Engine.runByScript (file:///Users/me/.nvm/versions/node/v16.20.0/lib/node_modules/sitespeed.io/node_modules/browsertime/lib/core/engine/index.js:308:20)
at async analyzeUrl (file:///Users/me/.nvm/versions/node/v16.20.0/lib/node_modules/sitespeed.io/lib/plugins/browsertime/analyzer.js:189:19)
at async BrowsertimePlugin.processMessage (file:///Users/me/.nvm/versions/node/v16.20.0/lib/node_modules/sitespeed.io/lib/plugins/browsertime/index.js:173:26)
[2024-04-16 12:20:59] INFO: https://whatever.com 19 requests, TTFB: 642ms, firstPaint: 915ms, FCP: 915ms, DOMContentLoaded: 914ms, LCP: 1.06s, CLS: 0.0563, TBT: 0ms, CPUBenchmark: 49ms, Load: 1.14s
[2024-04-16 12:21:00] INFO: HTML stored in /Users/me/workspace/sitespeed/sitespeed-result/index_mjs/2024-04-16-12-20-47
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the debugging tutorial and the reproduced call in scripts/index.mjs, then trace the commands object through the Browsertime run.js entry point shown in the stack trace. Done means the documented breakpoint example runs without the TypeError and the documentation matches the available command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, developer-experience
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100