New issue
Advanced search Search tips

Issue 659515 link

Starred by 155 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug


Show other hotlists

Hotlists containing this issue:
Hotlist-1


Sign in to add a comment

Sourcemaps containing ` break syntax highlighting further down the line

Reported by da...@sleeckx.be, Oct 26 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2896.3 Safari/537.36

Steps to reproduce the problem:
1. Setup TypeScript to transpile to JS and enable source mapping files
2. In TypeScript, write a string template, e.g. `${myVar}%`
3. Chrome devtools picks up the mapping file but syntax highlighting breaks after the string template line

What is the expected behavior?
Syntax highlighting should be able to handle typescript string templates.

What went wrong?
Syntax highlighting breaks.

Did this work before? N/A 

Chrome version: 56.0.2896.3  Channel: dev
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0
 

Comment 1 by da...@sleeckx.be, Oct 26 2016

BrokenSyntaxHighlighting.PNG
26.6 KB View Download
Labels: TE-NeedsTriageHelp
Components: -Platform>DevTools Platform>DevTools>Authoring
Labels: -Pri-2 Pri-1
Owner: lushnikov@chromium.org
Status: Assigned (was: Unconfirmed)
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7fc948857973a632e23bc4511cda112f48b0e7d2

commit 7fc948857973a632e23bc4511cda112f48b0e7d2
Author: lushnikov <lushnikov@chromium.org>
Date: Wed Nov 02 17:19:18 2016

DevTools: roll javascript codemirror mode.

The new javascript mode will:
- highlight "static" keyword in ES6
- possibly eliminate the typescript template string bug

BUG=659515
R=einbinder

Review-Url: https://codereview.chromium.org/2464363002
Cr-Commit-Position: refs/heads/master@{#429314}

[modify] https://crrev.com/7fc948857973a632e23bc4511cda112f48b0e7d2/third_party/WebKit/Source/devtools/front_end/cm/javascript.js

Status: Started (was: Assigned)
I wasn't able to repro your case - looks like it's not just the template string per se, but some other context which is in fault of breaking syntax highlight. Could you please share the copyable text which exhibits this behavior?

Status: Fixed (was: Started)
Ok, please speak up if this is still broken for you. I'll close the issue for now.

Comment 7 by da...@sleeckx.be, Nov 5 2016

It is. Had to find some time to break down the issue from a rather large code base.
You can find a small test-case over here: https://goo.gl/bFgKIV

However, as you mentioned, while I was narrowing down the problem, I also came to suspect that the string template is not the real cause of breaking the syntax highlighting...

On a side note: the code was compiled using TypeScript's nightly build (v2.1.0-dev.20161105), so there might be an issue with the inline source-mapping as well.
test.zip
2.2 KB Download
Status: Assigned (was: Fixed)
Thank you for the repro, reopening!

Comment 9 by dsouther@google.com, Nov 10 2016

NB: This seems to be independent of OS, I see it on Ubuntu with Version 54.0.2840.90 (64-bit)
Labels: -Pri-1 Hotlist-Polish Pri-2
Owner: einbinder@chromium.org
Joel, could you please take a look on this?
I am also seeing this in react JSX source if JSX element is on the same line.
chrome-template-string-bug.png
20.0 KB View Download

Comment 12 by darud...@gmail.com, Dec 28 2016

Ran into this today. Seems unrelated to Typescript or any other framework. From what I'm seeing it only breaks if there are multiple {} brackets within the template string. I don't have any issues in my other files where I have template strings that don't have multiple squiggly brackets. In this file, all syntax highlighting (and mouse over object/deceleration view) is broken after the first instance of this issue.
chrome issue.png
26.6 KB View Download

Comment 13 Deleted

Comment 14 by nomaed@gmail.com, May 14 2017

To narrowed down the issue so it also appears for me when editing snippets.
I have a case in which it is due to the return type annotation with a generic type.

function good(): Array {
    const test = `foo${module}bar`;
    console.log(test);
}

function bad(): Array<Foo> {
    const test = `foo${module}bar`;
    console.log(test);
}


Screen Shot 2017-05-14 at 15.22.56.png
23.3 KB View Download

Comment 15 by cha...@slb.com, May 16 2017

breaks on mac also... super annoying :(

Any plans on this one?

Comment 16 Deleted

Comment 17 by zulaw22@gmail.com, May 24 2017

This bug is fatal, can you fix it? 
Thanks a lot

Comment 18 by cha...@slb.com, May 31 2017

fwiw, this is mac OSX also...
Damn this is super annoying :(
Screenshot attached...
screen.png
44.1 KB View Download

Comment 20 Deleted

Comment 21 by gusta...@gmail.com, Jul 13 2017

I agree, it can't be that hard to match two tokens and then continue your format chain.
String Template gone wrong.jpg
16.8 KB View Download
Still seeing this issue Version 60.0.3112.90 (Official Build) (64-bit) Windows. Do you guys have any progress on this?
2017-08-10_1403.png
169 KB View Download

Comment 23 by caze...@gmail.com, Aug 10 2017

this annoys me daily, I've started adding: 

//`; 

to the end of lines containing templated strings, which fixes the formatting.
Can confirm that the fix from Comment 23 does work.

Experiencing this on OSX 10.10.5, Chrome Version 60.0.3112.90
Screen Shot 2017-08-17 at 10.08.24 AM.png
60.8 KB View Download
Quite an annoying issue! Would really like to see this addressed.
Not working for me.

macOS Sierra 10.12.6
Screen Shot 2017-09-20 at 13.59.17.png
110 KB View Download

Comment 27 by cha...@gmail.com, Sep 20 2017

So how many stars / comments does it take to get a comment from the chrome team?

A fix?

Comment 28 Deleted

Also still seeing this issue.  Yes it looks like it's a combinations of using Generics <T> with template strings.

Came here from: https://stackoverflow.com/questions/40864026/chrome-dev-tools-issue-with-es6-string-literals-typescript
Capture.PNG
10.7 KB View Download
same issue for me, i'm using
Version 64.0.3241.0 (Official Build) canary (64-bit)

Comment 31 by alu...@gmail.com, Nov 5 2017

This really needs some attention.
Working on this. Sorry everybody.
Status: Started (was: Assigned)

Comment 34 by alu...@gmail.com, Nov 8 2017

Great. Thank you!
Same issue here. Thanks!!!
I am also having the same issue 
Chrome Issue.PNG
6.1 KB View Download
Status: Fixed (was: Started)
This issue should be fixed in Canary by the recent CodeMirror role.
Cc: einbinder@chromium.org
 Issue 561301  has been merged into this issue.
Still seeing this in Version 66.0.3329.1 (Official Build) canary (64-bit) on Mac High Sierra  
Screen Shot 2018-01-23 at 12.38.13.png
157 KB View Download
This issue should be re-opened.  As the last poster indicated, this is still an issue when combining JSX syntax with template literals.

Environment:
MacOS High Sierra 10.13.1
Version 66.0.3340.0 (Official Build) canary (64-bit)


syntax-breaks.png
80.4 KB View Download

Comment 41 by kwin...@gmail.com, Feb 7 2018

I appreciate the efforts put into Chrome very much, but this issue is definitely not fixed.  The company I develop for uses Chrome exclusively for its web apps, and I'm a javascript/jsx developer so the Chrome Developer Tools is where I spend 30% of my day. My app is littered with back quotes, so any dev could imagine that this bug is starting to become the bane of my existence. Please reopen this ticket and fix the issue. 

Comment 42 by jatt...@mnubo.com, Feb 8 2018

I have just upgraded to Chrome 64.0.3282.140 (Official Build) (64-bit) (MacOS). The issue is happening on a file displayed with sourcemaps.

Build System: Webpack
Transpiler: Typescript
TSConfig: Compiler Options: "sourceMap": true
Webpack devtool: "inline-source-map"

Hope this helps.


Screen Shot 2018-02-08 at 16.00.16.png
169 KB View Download
I still see this issue in the latest builds of canary as well as standard chrome. 
bug still exist:
Google Chrome	64.0.3282.167 (Official Build) (64-bit) (cohort: 64_167_win)
Revision	bf44778c9ce98ecff1128b225a165728044bbdeb-refs/branch-heads
Capture.PNG
152 KB View Download

Comment 45 by cbow...@lixar.com, Feb 22 2018

I am also getting this bug for a long time on Mac for ReactJS, React Native and anything JSX with string templates.

Comment 46 by aris...@gmail.com, Mar 4 2018

This is still a bug. Can you please show it as "NON-FIXED" so that it can be fixed? Thank you.
This is super annoying. Bug still exists:
Version 67.0.3361.0 (Official Build) canary (64-bit)
Bug still exists.


Google Chrome	64.0.3282.186 (Official Build) (64-bit) (cohort: Stable)
Revision	9611116ee79c63602f452e4fae2242a61cf0672d-refs/branch-heads/3282@{#694}


Comment 49 by yag...@gmail.com, Mar 10 2018

Please note that i cannot set a break point anywhere beyond the back-tick. See the screenshot attached. 
Google Chrome	65.0.3325.146 (Official Build) (64-bit)
Revision	f926414266f7aecb5ec1bf1b5f93f8716976ceef-refs/branch-heads/3325@{#669}
OS	Linux
JavaScript	V8 6.5.254.31
screenshotofproblem.jpg
191 KB View Download

Comment 50 by 900i...@gmail.com, Mar 30 2018

Can you reopen this please?
Happens in: 
Google Chrome	65.0.3325.181 (Official Build) (64-bit) (cohort: Stable)
Screenshot_461.jpg
46.4 KB View Download
The same issue in 65.0.3325.181
Screen Shot on 2018-04-03 at 12_11_58.png
37.4 KB View Download
Please change the status of this issue as it is not fixed. Same problem for 65.0.3325.181 version.
Still occuring on Chrome 65, please reopen.
This issue still occuring in Chrome 65.0.3325.181 on Mac
This is happening also in Chrome 66.0.3359.117
chrome devtools.png
144 KB View Download

Comment 56 by alu...@gmail.com, Apr 24 2018

Based on all of the examples provided, here as well as on my own observations, I think it's clear that this isn't related to either TypeScript or JSX specifically but rather to the presence of template strings and angle brackets in the same source file.

TypeScript generics or JSX expressions or Flow generics trigger this bug when template strings are also present. 
Breaks in latest version of Google Chrome for Mac OS High Sierra

MacOS : MacOS High Sierra 10.13.4
Google Chrome : Version 66.0.3359.139 (Official Build) (64-bit)
Screen Shot 2018-05-08 at 12.51.32 PM.png
170 KB View Download
Also breaking for me and this should be reopened

Ubuntu 16.04.4 LTS
Google Chrome : Version 66.0.3359.170 (Official Build) (64-bit)

Selection_001.png
87.7 KB View Download
More than 20 months since this was reported and plenty of examples later, is there any update on this?
This is still not fixed. Making development difficult.

Comment 61 by whp...@gmail.com, Jun 8 2018

Confirmed this has and continues to unfixed.  As of today: 
Windows 7 Version 66.0.3359.181 

please re-open
This is still an issue on Chrome 67.0.3396.99 64-bit
I'm using sourcemaps with Typescript.
Also having this same issue. Google Chrome Version 67.0.3396.99
screenshot.PNG
18.2 KB View Download
Hey y'all. Give this a shot on Chrome Canary. 
I just tried and things are looking good.

Here's a before and after (chrome 67 vs chrome 69)


Screen Shot 2018-07-09 at 11.40.09 AM.png
94.1 KB View Download
 Issue 859872  has been merged into this issue.
This is not resolved for me in Chrome Canary (Version 69.0.3486.0 (Official Build) canary (64-bit)):
canary_screen.PNG
37.5 KB View Download

Comment 67 Deleted

It still fails at some conditions. Eg. take a look at this: (Canary 69.0.3486.0)
canary.PNG
15.5 KB View Download
Still seeing this for 67.0.3396.99 (Official Build) (64-bit) Mac OS X
Backticks in jsx seem to be the cause.

Screen Shot 2018-07-14 at 5.38.20 PM.png
87.0 KB View Download
Still having this issue.
Tested both on
Version 69.0.3497.12 (Official Build) dev (64-bit)
and
Version 65.0.3325.162 (Official Build) (64-bit)


When will we see the fix for this? Its almost 1+ year old
same -- seems to be worse than it was when I reported...
same problem.


Screen Shot 2018-08-07 at 17.55.57.png
203 KB View Download
In an email, someone working on this bug said that they are having difficulty reproducing it. Does anybody here have a reliable way of reproducing the error from scratch?
Here you go - angular app - https://github.com/chadbr/chrome-template-string-debug/
If you have a way to just load a file into the Sources window --

You can just pull this one in: https://github.com/chadbr/chrome-template-string-debug/blob/master/src/app/permissions.service.ts

Will this be fixed anyytime soon? happens to me in chrome 68.0.3440.84

Comment 78 Deleted

The bug is still reproduced Chrome 68.0.3440.106, Mac 10.13.6. Please reopen the issue. its very annoying.
In 68.0.3440.106 (ubuntu 17) the bug still happens, please fix it.
70.0.3527.0 - still broken!
Owner: kozy@chromium.org
Status: Assigned (was: Fixed)
This has been fixed in which version?

Comment 84 Deleted

This bug is pain in the ass. How long it can take to fix one bug in chrome?
If you're having trouble with this, one option is to use the Visual Studio Code debugger.  It integrates with Chrome but has its own parser which understands backticks.

It's not a perfect option, especially if you're not using Code for the rest of your development, but perhaps it will help someone.  One word of warning, it seems to get confused if you have the Chrome debugger open at the same time, which can be inconvenient if you want to use other Developer Tools panes...
Can you guys just fix this?  I use DevTools every day for work, and this is a deal-breaker.
It's broken syntax highlighting guys, breakpoints still work ok. There are workarounds above that have been mentioned. Could we quit whining about it and add some details that may help it actually get fixed? You can totally make a pull request on the Chromium project that can get brought back into Chrome if it's that much of a life-changing issue for you. I want it fixed as much as the next guy but it's definitely not ruining my day. Hook vs code debugger extension (that ties into chrome) into it and you can do your breakpoints with syntax highlighting fine. Switch to Firefox (which does this fine) when you're trying to debug source mapped JSX + template strings. Have a little bit of patience, there are plenty of bigger bugs floating around like when you set a breakpoint, try to debug a variable and the whole browser crashes. That's a bit bigger of an issue. There are 138 stars here so far, I'm sure it's on their radar. This issue is only 2 years old ya know.
It's not just the syntax highlighting, this also breaks the ability to examine values of variables during a debugging session. So yes, you can set a breakpoint in one of the broken sections, but you can't look at anything while you're there.

This bug was marked as Fixed for almost two full years, and was only recently re-opened again because of people's pestering. The attention is valuable and is having a positive outcome.
Yes, it's still happening and it's a bit annoying seeing that it was reported 2 years ago.

BUT, as mentioned before, you can just add // before ` on the Source and it works even without saving the file, now you can examine values.
if you have a value like myClass.property.deeper and you select that entire string, then mouse over it, it will inspect the values. There are watches, in version 70 we have live expressions in the console. There's instant feedback also in the console when typing a value. There definitely are ways to inspect your variables without the syntax highlighting working on the area you are trying to debug. I imagine that's why it's been taking so long to get this fixed.

As for attention, as I said before, let's talk less about whether or not it's a problem. We know it is, more talk about how to reproduce it, how the devs can see the problem themselves and then they can much easier make a fix. Maybe supply example projects or files that are afflicted by this bug. I know for sure currently it affects a webpack project that uses source mapping and combines both React JSX with template strings in the same file.

Someone previously said this happens in Angular too.
I published a project that repo's the issue on Aug 7 - hopefully it helps...

https://bugs.chromium.org/p/chromium/issues/detail?id=659515#c75
https://bugs.chromium.org/p/chromium/issues/detail?id=659515#c76

Thanks, Chad

This is really annoying and I've suffered it for years. Here's a workaround that works if your template strings are just for logging purposes - Add an extra \` at the end before the closing `
Major Problem for me too.
Same

Comment 96 by wgil...@gmail.com, Today (16 hours ago)

Still there

Sign in to add a comment