When pages function has an error (locally), the output is useless

You’ll get this:

✘ [ERROR] Your worker created multiple branches of a single stream (for instance, by calling `response.clone()` or `request.clone()`) but did not read the body of both branches. This is wasteful, as it forces the system to buffer the entire stream of data in memory, rather than streaming it through. This may cause your worker to be unexpectedly terminated for going over the memory limit. If you only meant to copy the request or response headers and metadata (e.g. in order to be able to modify them), use the appropriate constructors instead (for instance, `new Response(response.body, response)`, `new Request(request)`, etc).

[wrangler:err] AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  (0, import_assert5.default)(prepareStackTrace !== void 0)

    at getSourceMapper (/home/codespace/.npm/_npx/32026684e21afda6/node_modules/miniflare/dist/src/index.js:5749:30)
    at getSourceMappedStack (/home/codespace/.npm/_npx/32026684e21afda6/node_modules/miniflare/dist/src/index.js:5822:10)
    at reviveError (/home/codespace/.npm/_npx/32026684e21afda6/node_modules/miniflare/dist/src/index.js:5856:17)
    at handlePrettyErrorRequest (/home/codespace/.npm/_npx/32026684e21afda6/node_modules/miniflare/dist/src/index.js:5861:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async #handleLoopback (/home/codespace/.npm/_npx/32026684e21afda6/node_modules/miniflare/dist/src/index.js:8584:20)

This is a bug in Wrangler - 🐛 BUG: Always see strange internal assertion error in debugger when I encounter an exception. · Issue #4715 · cloudflare/workers-sdk · GitHub
The team have a PR open to fix it - fix: ensure `miniflare`/`wrangler` can source map in the same process by mrbbot · Pull Request #4719 · cloudflare/workers-sdk · GitHub

So hopefully it should be fixed in the next release :slight_smile:
For now, you can downgrade Wrangler

Great, thanks.

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