fokishopping.blogg.se

Webstorm debug react
Webstorm debug react












webstorm debug react
  1. #WEBSTORM DEBUG REACT HOW TO#
  2. #WEBSTORM DEBUG REACT FULL#

In the nodemon.json file, the command for execution is currently ts-node -r tsconfig-paths/register src/main.ts. Instead of using ts-node directly (which is what we do for a lot of Typescript projects), we should rather start up node normally and register the ts-node module. The next step is to configure our package.json and nodemon.json files to allow for debugging. You'll notice that I bind port 9229 in my docker-compose.yaml file, this will be very applicable in the next steps so don't forget it! For future comparison, this is what the package.json and nodemon.json files look like in the backend folder before I set up the debugger, Enabling the Debugger in a Typescript ProjectĬool so we're set up with the docker-compose.yaml and Dockerfile and if you run docker-compose up -build you should see the system build and start up. So currently, my docker-compose.yaml and Dockerfile look as follows, You'll also see a devops folder where I keep the docker-compose.yaml file and the Dockerfile that should be used to build the backend code.įinally, I bind the backend/src directory into the docker container so that changes are picked up by nodemon during development and there's a quick project rebuild and restart without having to restart the docker container. I'm using a nest project and I've placed the code into a backend folder. As long as you have docker and docker-compose installed, it should all work! If you'd like to follow in the example, you can clone the GitHub repository.

webstorm debug react

I've used nest as our framework since that's what is most applicable in our use cases.

#WEBSTORM DEBUG REACT HOW TO#

This article outlines how to set up debugging in a Typescript project that runs using docker containers. The tutorials were great but I couldn't find one that explained the process from start to finish, this article was what I worked off to get to this answer. So I started reading around and found that there are ways to bind to the debug ports for node projects. This means that the current solutions out there won't work for us, unless we want to run half of the stack through docker-compose and the other half directly on our PCs.

#WEBSTORM DEBUG REACT FULL#

Furthermore, we use docker-compose, to set up the full stack for local development. We use docker for our development environment to ensure that there is a fast setup. The problem is that that solution assumes we are running the application directly off our PCs. It's pretty straight forward, all you have to do is set up the execution script in Webstorm (or any IDE really) and you're good to go. I've recently been looking at how people debug Typescript applications.














Webstorm debug react