So I am having this really weird thing where my javascript doesn't show in my sources window. If I set a debugger
in my js and then reload the page, it will break and I can see the javascript. The weird thing is that instead of the tab being labeled MyJavascriptFile.js
it reads [VM](62)
or some other number. I have tried reinstalling chrome and it didnt fix my problem. It didn't used to be like this, any ideas what is going on? Its just really annoying to have get to my javascript by adding debugger statements.
The Sources panel is where you debug JavaScript. Open DevTools by pressing Command+Option+I (Mac) or Control+Shift+I (Windows, Linux). This shortcut opens the Console panel. Click the Sources tab.
You can do this with the keyboard using the shortcut CMD-OPT-I on macOS or CTRL-SHIFT-I on Windows. The Dev Tools will now be open inside the browser tab, and the Console tab will be active. This tab allows you to execute arbitrary JavaScript code at any time or to view any outputs from console.
Google ChromeIn the "Settings" section click on the "Show advanced settings..." Under the the "Privacy" click on the "Content settings...". When the dialog window opens, look for the "JavaScript" section and select "Allow all sites to run JavaScript (recommended)". Click on the "OK" button to close it.
Press Command+Option+J (Mac) or Control+Shift+J (Windows, Linux, ChromeOS) to open the Console, right here on this very page.
I'm having this problem right now. Must be a bug in Chrome. All you have to do is load the console (f12) then reload the page whilst the console is loaded. You can now see your code.
The weird thing is that instead of the tab being labeled MyJavascriptFile.js it reads VM or some other number.
This is because you are accessing your script through localhost
, and therefore running into security policies. If you host your file at an IP or domain name, you'll be able to debug normally again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With