Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tizmagik/cf-worker-async-proxy-repro

Reproduction of an issue discovered while using new Proxy() within an async call
https://github.com/tizmagik/cf-worker-async-proxy-repro

Last synced: about 1 month ago
JSON representation

Reproduction of an issue discovered while using new Proxy() within an async call

Awesome Lists containing this project

README

        

# CF Worker + Async Proxy Error Reproduction

This repository is a reproduction of an error that occurs when using Cloudflare Workers with an async proxy.

## Error

When using an async proxy in a Cloudflare Worker, the following error is thrown:

```
Error: The script will never generate a response.
at async Object.fetch (file:///Users/jeremygayed/src/repro/node_modules/miniflare/dist/src/workers/core/entry.worker.js:1026:22)
```

## Reproduction

To reproduce the error, run the following commands:

```bash
npm install
npm run start
```

To toggle the error, switch between using `createAsyncRouter` and `createRouter`.

Just by calling `createAsyncRouter` instead of `createRouter`, the error is shown -- even if you don't use the returned value.