cloudflare / cloudflare/workerd

Odd "Error: The script will never generate a response." error with esbuild and top-level await

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

Description

I've tried to use esbuild with workers, but rain into odd issue with esbuild and top-level await in workerd.

I don't really know what's going on here but it seems that something is off with our task/microtask scheduling from the top-level context (outside of a request context).

I created a repro with instructions in README.md: https://github.com/IgorMinar/repro-workers-sdk-2029-top-level-await

This repro contains several patches and workarounds for other issues that I identified and reduced while trying to get esbuild to work. The repro also contains a workaround for this last scheduling issue: https://github.com/IgorMinar/repro-workers-sdk-2029-top-level-await/compare/esbuild-broken...esbuild-fixed

It would be awesome if someone familiar with the workerd could take a look at the repo and root-cause this problem or reduce the issue further. Thanks

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.