Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: TypeError: commands.breakpoint is not a function #4140

Open
2 tasks done
petemyron opened this issue Apr 16, 2024 · 1 comment
Open
2 tasks done

ERROR: TypeError: commands.breakpoint is not a function #4140

petemyron opened this issue Apr 16, 2024 · 1 comment
Labels

Comments

@petemyron
Copy link

petemyron commented Apr 16, 2024

Have you read the documentation?

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
@petemyron petemyron added the bug label Apr 16, 2024
@soulgalore
Copy link
Member

Hi @petemyron thanks for reporting, the docs are wrong, I'll fix that tonight. The correct is: await commands.debug.breakpoint('');

Best
Peter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants