sitespeed.io
sitespeed.io copied to clipboard
ERROR: TypeError: commands.breakpoint is not a function
Have you read the documentation?
- [X] Yes, I've read the how to make a reproducable bug guide
- [X] Yes, I've read the how to debug my script guide
URL
https://google.com
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
Hi @petemyron thanks for reporting, the docs are wrong, I'll fix that tonight. The correct is: await commands.debug.breakpoint('');
Best Peter