cloudflare / cloudflare/workerd

🐛 BUG: ‘Step over’ on `await` clause in debugger completely resumes execution

Open
#2,962 0 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

### Which Cloudflare product(s) does this pertain to?

Wrangler core

### What version(s) of the tool(s) are you using?

3.15.0 [Wrangler]

### What version of Node are you using?

20.8.1

### What operating system are you using?

Linux (Ubuntu 20.04)

### Describe the Bug

Write the following worker:

```ts
export default {
fetch: async () => {
await new Promise((resolve) => {
setTimeout(resolve, 5_000);
});
return new Response("OK");
},
};
```

Attach a debugger in local mode and set a breakpoint on the `await` line. Once it breaks, click ‘step over’ on your debugger. I would expect the program to move to the `return` line, but instead the debugger just completely resumes execution, returning the response to my client. This makes it hard to step through code because I have to add a breakpoint after every `await`.

### Please provide a link to a minimal reproduction

_No response_

### Please provide any relevant error logs

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.