Is it possible to debug Cloudflare Pages functions in VS Code?

While I’m able to get step debugging working in VS Code within Cloudflare workers (with the help of this link: Better debugging for Cloudflare Workers, now with breakpoints), it seems that by following the similar procedures, I cannot get the same to work with Cloudflare Pages functions. Before I go further––is this even supported?

I am able to get step debugging to work with Cloudflare Pages functions if I open up a Chrome debugging window after launching wrangler and pressing [d]. I just can’t get VS Code to stop on my breakpoints.

1 Like

Hi @paul118

As you already found out, then we do not have the same option in Pages as we do for Workers, so at this point you only have the option in Chrome Dev Tools.

Cloudflare is continuously updating their tools, so this feature may be supported in the future, but currently, there is no integrated VS Code debugging for Pages Functions.

Sorry for the inconvenience this is causing you.

Hi @paul118, your topic has a solution here.

Let us know what you think of the solution by logging in and give it a :+1: or :-1:.


Solutions help the person that asked the question and anyone else that sees the answer later. Login to tell us what you think of the solution with a :+1: or :-1:.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.