Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

chrome devtools source not inspectable after backtick

If I stop my javascript code in a breakpoint and try to inspect certain part of the code like a variable or a function by hovering over, it gives a popup with its value like in the screenshot below:

enter image description here

But If I use es6 template strings in my code like this:

options.push(<option key={`traveller-age-option-${i}`}>{i}</option>);

Then the entire code below the backtick character (`) becomes red and if I hover over it - I'm not able to inspect any values - nothing happens - it is treated as a string

enter image description here

Because of this I have to manually go to console and type the value - not hover and see it's value.

How to fix this?? Is there a webpack option or some source-map or any chrome plugin which helps with this??

like image 216
Probosckie Avatar asked Feb 15 '18 05:02

Probosckie


People also ask

How do I fix dev tools in Chrome?

# Open the Issues tab Open DevTools. Click the Go to Issues button in the yellow warning bar. Alternatively, select Issues from the More tools menu. Once you're on the Issues tab, click the Reload page button if necessary.

How do you dock DevTools?

Change where DevTools is docked by using the Command Menu Or, press Shift + Ctrl + P on Windows/Linux or Command + Shift + P on macOS. Type dock, and then select a dock command: Dock to bottom.

How do I enable console debugging in Chrome?

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.


1 Answers

There's a workaround using comments to test as explained in this other question

Seems to be a bug known by the Chromium team and they've been working on it for quite a while. Issue here

Hope that workaround makes your life a bit easy while debugging

like image 144
samus24 Avatar answered Oct 22 '22 11:10

samus24