Attaching a Debugger
Last updated Apr 23, 2026 Caution
This documentation describes breakpoint debugging when using Miniflare directly, which is only relevant for advanced use cases. Instead, most users should refer to the Workers Observability documentation for how to set this up when using Wrangler.
You can use regular Node.js tools to debug your Workers. Setting breakpoints, watching values and inspecting the call stack are all examples of things you can do with a debugger.
Visual Studio Code
Create configuration
The easiest way to debug a Worker in VSCode is to create a new configuration.
Open the Run and Debug menu in the VSCode activity bar and create a .vscode/launch.json file that contains the following:
---
filename: .vscode/launch.json
---
{
"configurations": [
{
"name": "Miniflare",
"type": "node",
"request": "attach",
"port": 9229,
"cwd": "/",
"resolveSourceMapLocations": null,
"attachExistingChildren": false,
"autoAttachChildProcesses": false,
}
]
}
From the Run and Debug menu in the activity bar, select the Miniflare configuration, and click the green play button to start debugging.
WebStorm
Create a new configuration, by clicking Add Configuration in the top right.

Click the plus button in the top left of the popup and create a new Node.js/Chrome configuration. Set the Host field to localhost and the Port field to 9229. Then click OK.

With the new configuration selected, click the green debug button to start debugging.

DevTools
Breakpoints can also be added via the Workers DevTools. For more information, read the guide in the Cloudflare Workers docs.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/workers/testing/miniflare/developing/debugger/#page","headline":"Attaching a Debugger","description":"Attach a Node.js debugger to Miniflare for setting breakpoints and inspecting Cloudflare Workers code.","url":"https://developers.cloudflare.com/workers/testing/miniflare/developing/debugger/","inLanguage":"en","image":"https://developers.cloudflare.com/workers/testing/miniflare/developing/debugger/og.png?v=7249a4a711859c61","dateModified":"2026-04-23","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Enable automatic browser refresh in Miniflare when your Workers script changes during local development. title: Live Reload image: https://developers.cloudflare.com/workers/testing/miniflare/developing/live-reload/og.png?v=2d136a4ce470ca0b
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/workers/llms.txt
Use this file to discover all available pages before exploring further.
