Cant debug worker in Webstorm

Hey, I used wrangler to create a Cloudflare worker project. Its stored on wsl. I am using WebStorm (installed on Windows) to develop in it. When setting break points and launching the dev profile in debug mode, the breakpoint doesnt trigger. this ist also true for tests Im writing (with vitest). How can I get debbuging functionality in Webstorm and why does it not work in the first place? Im sorry if this is not a cloudflare specific issue, but I sadly could not get it to work so I would be grateful for help. Thanks a lot. Things I tried: I updated my tsconfig to this:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["@cloudflare/vitest-pool-workers"],
"sourceMap": true,
"inlineSources": true
},
"include": ["./**/*.ts", "../worker-configuration.d.ts"],
"exclude": []
}
{
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["@cloudflare/vitest-pool-workers"],
"sourceMap": true,
"inlineSources": true
},
"include": ["./**/*.ts", "../worker-configuration.d.ts"],
"exclude": []
}
Launch options for Vitest are:
--run --inspect-brk --no-file-parallelism --test-timeout=0
--run --inspect-brk --no-file-parallelism --test-timeout=0
Im not sure what other information I can provide, so just ask :)
7 Replies
Razboy20
Razboy205mo ago
The Cloudflare Blog
Better debugging for Cloudflare Workers, now with breakpoints
We provide many tools to help you debug Cloudflare Workers; from your local environment all the way into production. In this post, we highlight some of the tools we currently offer, and do a deep dive into one specific area - breakpoint debugging - a tool we recently added into our workerd runtime.
Razboy20
Razboy205mo ago
One of the examples given is Webstorm
Franz3
Franz3OP5mo ago
thank you very much, I will give it a look and will be back if that doesnt help
Franz3
Franz3OP5mo ago
No description
Franz3
Franz3OP5mo ago
No description
Franz3
Franz3OP5mo ago
@Razboy20 thanks a lot. this helped and I could get it to work. I even managed to use a compund so that I dont have to manually start the server all the time :) --inspect is essential here and what I was missing beforehand. Thanks, this makes developing so much nicer
Razboy20
Razboy205mo ago
Great! Glad I could help point you in the right direction.

Did you find this page helpful?