Skip to content

What should the links do? #10

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
philholden opened this issue Sep 4, 2015 · 5 comments
Closed

What should the links do? #10

philholden opened this issue Sep 4, 2015 · 5 comments

Comments

@philholden
Copy link

I notice errors are links e.g.

webpack:///./src/components/Pane.js?:186:56

Clicking the link does nothing. How do I make the link do something interesting like display that line in context in editor or browser.

@gaearon
Copy link
Contributor

gaearon commented Sep 4, 2015

I don't think browsers have API for this. The “links” just roughly give you an idea of where source file is.

@mxlje
Copy link
Member

mxlje commented Sep 8, 2015

We could look into changing the links so that they open an editor with the file at that specific line, if the URL scheme is registered. Better Errors for example does this for Rack Apps.

https://github.com/dhoulb/subl for example allows to set up a subl:// URL handler for Sublime Text and I’m sure this could be done for other editors as well.

@davidpfahler
Copy link
Member

As @mxlje said, the idea was to change this at some point in the future to open the line of code somewhere. My original intent was to open them in the chrome dev tools, but maybe we can come up with a better idea.

@gaearon
Copy link
Contributor

gaearon commented Sep 15, 2015

I think opening in the editor would be awesome. FYI, starting with react-transform-catch-errors@0.1.3, the error component also receives filename. This means you can use it regardless of whether the user has source maps enabled, and it's guaranteed to be the absolute file name (although of course you only get it for the component whose render failed—not for any other item in the stack trace).

@trueter
Copy link

trueter commented Sep 29, 2015

FYI Jetbrains IDEs also support URL handlers with little configuration.

Jetbrains and Sublime allow to specify line numbers. Maybe we could also pass them down to the <ErrorReporter />, @gaearon?

stevoland added a commit to stevoland/redbox-react that referenced this issue Oct 30, 2015
If filenames are absolute the generated links can be opened
in an editor if the `editorScheme` property is set.

If `react-transform-catch-errors` passes in a `filename` this
is used for the top function if the stack trace filename
isn't absolute

Closes: commissure#10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants