Closed andresgutgon closed 1 year ago
I'll have a look next week. It's totally new for me but nice you've shared it. Don't get too frustrated though, perfectly normal sometimes 😀
BTW really feel free to make a small pr with the dev:debug script on this repo. I'll merge and try.
Thanks! I'm trying to take a scientific aproach here 🤓 starting by standalone nextjs with javascript and go up to full monorepo pnpm typescript
https://github.com/andresgutgon/nextjs-debugging
So far I'm in the most simple case following their docs and I'm not understanding how debugging works in node. I did manage to debug a simple express one file server tho. So much be something related with nextjs and sourcemaps.
Nice. Have you tried it with a getserversideprops route ?
With default pages/api/hello
which is ultra simple. The problem is that Chrome Dev Tools don't even see that code so I can't put a debugger
mmm. I saw that you use turbo to run the command, might be that too ? (ie https://github.com/vercel/turbo/blob/main/packages/turbo/install.js#L190)
Yes, I use turbo in my app but in the playground i use plain nextjs app with npm
. I want to start as simple as possible and understand what's happening
Let me know when you find out... super interested as well. And thanks for your work
Ok I think I found the right issue I'm having I'm able to stop the debugger 🎉
The fix is in this PR which is still pending https://github.com/vercel/next.js/pull/51467
I wanted to try so I forked NextJS repo and copied these changes and looks it working
Thanks for the tip.
What?
Hi, nice to meet you. I've been looking for a solution for this hours and I don't find anything. So first of all sorry for creating an issue in this repo 🙏. But I think this can be really helpful for a lot of people. Debugging Node is not always easy
The problem. Debug node server NextJS app
I'm following their oficial docs: https://nextjs.org/docs/pages/building-your-application/configuring/debugging#server-side-code
But these docs are for a flat next app not for an app living in a monorepo like this so maybe someone already did this.
In my case this is my setup
pnpm
turbo
nextjs 13.x.x
I'm trying this
And i have a nextjs app called
apps/web/package.json
I see the debugger session:
And going to the app on
http://localhost:3000
I see Node debugger sessionBut if I open it any file of my app is there. Only react
I'm out of idea 😓