cloudflare / cloudflare/vinext

Built worker fails in workerd: Class extends value async function is not a constructor (wrapWorkerEntrypoint)

Open
#3,185 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.8k
Forks
406
Avg merge
2d 6h
Merged PRs (30d)
120

Description

## Setup
- vinext 1.0.0-beta.9, App Router under `src/` (`appDir: "src"`), 165 pages
- `vinext build` succeeds; `vinext start` serves correctly (real pages, RSC, rewrites)
- Failure occurs loading the built worker (`dist/server/index.js`) under real workerd via `wrangler dev`

## Error
`Uncaught TypeError: Class extends value async function ... is not a constructor or null` at `wrapWorkerEntrypoint` (minified index.js). Full trace available on request — the heritage expression references minified code around cache-adapter registration (`registerCacheAdapters`).

## Notes
- `vinext start` (Node SSR entry) works, so this looks specific to the worker entry bundle — possibly a minifier emitting an async-function class heritage, which is a spec-level TypeError in every engine.
- No custom minify settings; stock `vinext build` output.
- Related context: same project tracks dev-mode 404s with `src/` layout in #3184.

Contributor guide

Open the contributing guide

Research direction

Reproduce with the reported `vinext build` output and `wrangler dev`, then inspect `dist/server/index.js` around `wrapWorkerEntrypoint` and `registerCacheAdapters`. Compare the worker entry behavior with the working Node SSR entry; done means the built worker loads in real workerd without the class-heritage TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, build-system, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.