google / WebFundamentals

Former git repo for WebFundamentals on developers.google.com
Apache License 2.0
13.86k stars 2.57k forks source link

The page says that one can call debug() from the console, but doing so generates an "Uncaught TypeError: debug is not a function" #8088

Open ssaux opened 4 years ago

ssaux commented 4 years ago

Welcome! Please use this template for reporting documentation issues on https://developers.google.com/web/.

For questions about Chrome DevTools, checkout the google-chrome-devtools tag on StackOverflow. For questions about Chrome, check the google-chrome tag. If you think you've found a Chrome bug, check out our feedback page for more details on how to file it.

Page Affected: https://developers.google.com/web/TODO

What needs to be done?

Please provide description of what's needs to be done here. Please be sure to include the link to the original page and any supporting links/data.

connerturner commented 4 years ago

Can you provide a link to the page you're referring to? If you mean the Console API then ensure you are calling console.debug() and not just the function debug()

ssaux commented 4 years ago

Here’s the page that could be improved: https://developers.google.com/web/tools/chrome-devtools/javascript/breakpoints#function It never references debug as a method of console and even provides several example where it’s called as a top-level function, and this page is what I found with this search “chrome dev window setting a breakpoint in js that doesn't appear in sources” rather than the API page you mention, which is pretty clear.

From: Conner Turner notifications@github.com Reply-To: google/WebFundamentals reply@reply.github.com Date: Saturday, September 7, 2019 at 8:21 PM To: google/WebFundamentals WebFundamentals@noreply.github.com Cc: "Saux, Stephane" SSaux@sfchronicle.com, Author author@noreply.github.com Subject: Re: [google/WebFundamentals] The page says that one can call debug() from the console, but doing so generates an "Uncaught TypeError: debug is not a function" (#8088)

Can you provide a link to the page you're referring to? If you mean the Console API https://urldefense.proofpoint.com/v2/url?u=https-3A__developers.google.com_web_tools_chrome-2Ddevtools_console_api&d=DwMCaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=qIVf_9uN-B_t84iaE3qzU1qE3Gq-NkOXmH7ogp4L-3U&m=EGlwDErz-QX0W0Q1Ab73-pP08gzbmskYNF73r5inUT4&s=A712-yZH4MZ3ksogqLMjZ5bh6vjpYZo5RbEySCwAeJY&e= then ensure you are calling console.debug() and not just the function debug()

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_google_WebFundamentals_issues_8088-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAEA7UQ5SEE6YZMBWE5H2S4DQIRVSJA5CNFSM4IT7R7P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6FG3MA-23issuecomment-2D529165744&d=DwMCaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=qIVf_9uN-B_t84iaE3qzU1qE3Gq-NkOXmH7ogp4L-3U&m=EGlwDErz-QX0W0Q1Ab73-pP08gzbmskYNF73r5inUT4&s=ox6k63MWGvjMCvlAbcznlrI0IoeOKwLwWlqEFuxm1M8&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AEA7UQ2FSWONNGYQWQ4R24LQIRVSJANCNFSM4IT7R7PQ&d=DwMCaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=qIVf_9uN-B_t84iaE3qzU1qE3Gq-NkOXmH7ogp4L-3U&m=EGlwDErz-QX0W0Q1Ab73-pP08gzbmskYNF73r5inUT4&s=kFZrc-GpBmjD4C6e88ZKYMEEqZDEEQTHRtwXhTVvrjo&e=.

ssaux commented 4 years ago

Reading the console api, console.debug is just an alias for console.log, while the debug function referenced in the page https://developers.google.com/web/tools/chrome-devtools/javascript/breakpoints#function Is purported to allow one to set a breakpoint in a particular function. The problem I was trying to solve had to do with debugging code that is part of the eval script from prototype updater. The code doesn’t appear in the source tab of the dev window. I was hoping to be able to set the breakpoint using that method (although it might not work either). Other issues with eval script (but that’s a prototype issue) is that if there’s a syntax error in the script being eval’ed, it’s not shown in the console (I suppose prototype eats the error).

From: Conner Turner notifications@github.com Reply-To: google/WebFundamentals reply@reply.github.com Date: Saturday, September 7, 2019 at 8:21 PM To: google/WebFundamentals WebFundamentals@noreply.github.com Cc: "Saux, Stephane" SSaux@sfchronicle.com, Author author@noreply.github.com Subject: Re: [google/WebFundamentals] The page says that one can call debug() from the console, but doing so generates an "Uncaught TypeError: debug is not a function" (#8088)

Can you provide a link to the page you're referring to? If you mean the Console API https://urldefense.proofpoint.com/v2/url?u=https-3A__developers.google.com_web_tools_chrome-2Ddevtools_console_api&d=DwMCaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=qIVf_9uN-B_t84iaE3qzU1qE3Gq-NkOXmH7ogp4L-3U&m=EGlwDErz-QX0W0Q1Ab73-pP08gzbmskYNF73r5inUT4&s=A712-yZH4MZ3ksogqLMjZ5bh6vjpYZo5RbEySCwAeJY&e= then ensure you are calling console.debug() and not just the function debug()

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_google_WebFundamentals_issues_8088-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAEA7UQ5SEE6YZMBWE5H2S4DQIRVSJA5CNFSM4IT7R7P2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6FG3MA-23issuecomment-2D529165744&d=DwMCaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=qIVf_9uN-B_t84iaE3qzU1qE3Gq-NkOXmH7ogp4L-3U&m=EGlwDErz-QX0W0Q1Ab73-pP08gzbmskYNF73r5inUT4&s=ox6k63MWGvjMCvlAbcznlrI0IoeOKwLwWlqEFuxm1M8&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AEA7UQ2FSWONNGYQWQ4R24LQIRVSJANCNFSM4IT7R7PQ&d=DwMCaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=qIVf_9uN-B_t84iaE3qzU1qE3Gq-NkOXmH7ogp4L-3U&m=EGlwDErz-QX0W0Q1Ab73-pP08gzbmskYNF73r5inUT4&s=kFZrc-GpBmjD4C6e88ZKYMEEqZDEEQTHRtwXhTVvrjo&e=.