#Debugging a medusa package w/ VS Code debugger

13 messages · Page 1 of 1 (latest)

sterile ridge
#

Hi all,

We're seeing an issue when customers are hitting the /carts/:id to update their cart.

I'm following these docs here (https://docs.medusajs.com/development/fundamentals/local-development) to debug the medusa package locally. All is working well, but having trouble setting up the vs code debugger.

I have these two scripts setup in the package.json file

"watch": "tsc --build --watch",
"debug": "node --inspect-brk -r ts-node/register src/index.js",

the breakpoints are being mounted but not hitting them it seems. have any of you tried to do anything similar?

wise jungle
#

It's fairly straight forward..The break points need to be in the node_modules js files

sterile ridge
#

@wise jungle wow lol. I thought the code would've all been minified!

#

ty

wise jungle
#

Nope not all if it..thank god

#

Only the browser code is minified

#

Medusa-js and medusa react

sterile ridge
#

@wise jungle are you able to set breakpoints on the .ts files in node_modules?

wise jungle
#

No..there aren't any ts files in node modules

sterile ridge
#

@wise jungle I believe it's because I'm debugging a package locally, but yes, I do see them

wise jungle
#

Hmm. I am surprised

#

Normally only the compiled files are in the node_modules

sterile ridge
#

@wise jungle I am sym-linking the package using the medusa CLI