Skip to content

Debugging next.js apps #260

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
arrowplum opened this issue Nov 15, 2016 · 11 comments
Closed

Debugging next.js apps #260

arrowplum opened this issue Nov 15, 2016 · 11 comments
Labels
please add a complete reproduction Please add a complete reproduction.

Comments

@arrowplum
Copy link

With the way javascript is loaded, it looks like you can't use a debugger on your own code. At least not the developer tools debugger.

I haven't seen any other mention of this issue so is there something I am missing, or is next.js not intended for larger projects?

@erictherobot
Copy link

I'm not sure if this is helpful, but I have been building a rather larger project with NEXT and have had no issues with using this https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en for debugging. You can access everything including components, props, state, etc. Good luck!

@rauchg
Copy link
Member

rauchg commented Nov 16, 2016

@arrowplum like @erictherobot says, the React Dev Tools should work out of the box. What other tools were you looking to integrate?

@dbo
Copy link
Contributor

dbo commented Nov 16, 2016

What about cmd+O to open your component code to place breakpoints?

@dbo
Copy link
Contributor

dbo commented Nov 16, 2016

I think this would require source maps being emitted by webpack, thus depend on PR #222. IMO source maps should be a default for next dev.

@lachlanjc
Copy link
Contributor

@rauchg Yep, the React Dev Tools work fine for me, but I'd like to use native JavaScript debugger. I've got some code that runs before my React component renders (not modifying props/state) and it'd be great if I could stop the code in there and use the regular browser Dev Tools.

@nkzawa
Copy link
Contributor

nkzawa commented Nov 18, 2016

I could use debugger on Chrome like

render () {
  debugger
  return <div>hi</div>
}

@nkzawa nkzawa added the please add a complete reproduction Please add a complete reproduction. label Nov 18, 2016
@dbo
Copy link
Contributor

dbo commented Nov 18, 2016

@nkzawa I can't open any of my modules in Chrome devtools (cmd+O) without tweaking the webpack config to emit source maps (devtool: 'eval').

@eezing
Copy link

eezing commented Nov 22, 2016

Can this be addressed with a source maps change in webpack? I myself would be very happy to have this.

@dbo
Copy link
Contributor

dbo commented Nov 22, 2016

As far as I see this gets addressed either via PR #279 or you can tweak it when PR #222 has landed.

@nkzawa
Copy link
Contributor

nkzawa commented Dec 2, 2016

Source map has been supported now.

@nkzawa nkzawa closed this as completed Dec 2, 2016
@arrowplum
Copy link
Author

@nkzawa is that PR #279 ?

@lock lock bot locked as resolved and limited conversation to collaborators May 12, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
please add a complete reproduction Please add a complete reproduction.
Projects
None yet
Development

No branches or pull requests

7 participants