Uh oh!
There was an error while loading. Please reload this page.
Enable click to go to error in console - #5624
Conversation
Timer
commented
Oct 30, 2018
I thought VS Code supported this without a full path, assuming the path matches the workspace folder opened in VS Code. Does it need to be prefixed with |
Sorry I don't follow you? What's the thing that is prefixed with I see the same path webpack outputs repeated with Feel like I've missed your meaning? (I'm on my phone - perhaps GitHub is hiding something from me 😄) |
Timer
commented
Oct 30, 2018
Sorry, I can try to explain better! I thought VSCode supported "Click to open" with relative paths, i.e. I'm all good for adding |
weswigham
commented
Oct 30, 2018
Yeah, vscode supports relative paths in its terminal. You don't need the leading |
Awesome! Only problem: how do I get the workspace location in the context of the Can I depend upon |
weswigham
commented
Oct 30, 2018
I think |
johnnyreilly
commented
Oct 30, 2018
Thanks - I'll experiment with that and report back |
@johnnyreilly import |
johnnyreilly
commented
Oct 31, 2018
cheers @Timer - will have a play |
johnnyreilly
commented
Nov 3, 2018
Hey @Timer, I've made the suggested change; here's what it looks like with it in place: |
ianschmitz
commented
Nov 3, 2018
Looking good! Perhaps we should strip the leading slash? |
Timer
commented
Nov 3, 2018
We need to somehow morph this path with the (above) highlighted line. |
johnnyreilly
commented
Nov 3, 2018
Yeah could do
I would love to do that! Alas, unless I've misunderstood things, the (above) highlighted line is not part of the formatter output. It's emitted by webpack I think. Do you know a way to control that? |
Timer
commented
Nov 3, 2018
We control that output here: We should be able to teach it the necessary trick there. :-) |
johnnyreilly
commented
Nov 3, 2018
Nice, nice! Will experiment... |
johnnyreilly
commented
Nov 3, 2018
Hmmm... There's a number of call sites. Should be fine: Should be fine, this file already imports https://github.com/facebook/create-react-app/blob/aac14ea5798f991c96e94ff29a7797a823ca7196/packages/react-scripts/scripts/build.js#L151 But I'm not sure how to make this work nicely: https://github.com/facebook/create-react-app/blob/aac14ea5798f991c96e94ff29a7797a823ca7196/packages/react-dev-utils/webpackHotDevClient.js#L124 Any ideas? |
The issue being the way
Is there a nice way that |
johnnyreilly
commented
Nov 7, 2018
@ianschmitz / @Timer - any thoughts on how I can advance this? |
Timer
commented
Nov 8, 2018
Hey @johnnyreilly, I'm a little tight on time right now so I need to defer to some other collaborators. I'm very interested in moving this forward though (and will get around to it eventually if someone else doesn't). |
johnnyreilly
commented
Nov 8, 2018
That's cool @Timer - when you're ready then let me know! |
ianschmitz
commented
Nov 8, 2018
Yeah I've been looking at it for a little while - this is a tricky one... Taking a step back, could we do something as simple as stripping out everything before |
johnnyreilly
commented
Nov 8, 2018
Sounds possible; like you I've no idea of the answers to the questions. |
alexkuz
commented
Nov 28, 2018
@johnnyreilly As I understand this PR only deals with TypeScript, shouldn't we also use Also it's probably better to use BTW you might be interested in how they did it in TSLint: palantir/tslint#3491 |
This should cater for both
In my experience the |
alexkuz
commented
Nov 29, 2018
But I'd need to eject for that, right? I'll better try to convince iTerm maintainers to support |
alexkuz
commented
Dec 15, 2018
if anyone interested, iTerm2 now supports |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
johnnyreilly
commented
Jan 18, 2019
I'd quite like to get this in - I'm waiting on advice on how to take this forward. |
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
johnnyreilly
commented
Feb 17, 2019
Could someone advise on how we could take this forward please? |
ianschmitz
commented
Feb 19, 2019
I've taken a look at We can create a separate issue to figure out a better way where we can use |
johnnyreilly
commented
Feb 19, 2019
Cool - when I get a moment I'll give it a go! |
…HotDevClient uses process.cwd() as discussed with @ianschmitz
johnnyreilly
commented
Feb 23, 2019
okay - merging is a world of pain. I regret even attempting this. I'll fork and apply my changes to that |
johnnyreilly
commented
Feb 23, 2019
Closing in favour of #6502 |

At present when using CRA with TypeScript, you can click on an error in the console and go to the erroring file. This is great!
What would be even better, is if you went directly to the line and column where the error is happening like this:
This PR enables this by augmenting the output in the
typescriptFormatter. There is some duplication in the console as webpack already displays the filepath alone.Certainly for myself, I'd take this duplication to unlock the ability to click and go directly to an error. (This is what the default formatter in
fork-ts-checker-webpack-plugindoes.)What do you think?