postgres icon indicating copy to clipboard operation
postgres copied to clipboard

Fix memory leak by removing custom net/tls polyfills

Open astralhpi opened this issue 3 months ago • 1 comments

Problem

Custom Socket polyfill implementation was causing memory leaks in Cloudflare Workers environments.

Solution

Removed custom net/tls polyfills since Cloudflare Workers now provide built-in polyfills for these modules.

Changes

  • Removed custom net/tls polyfill imports from Cloudflare build
  • Updated transpilation to use Cloudflare's built-in polyfills instead

Result

  • Fixes memory leak in Worker environments

Reproducer: https://github.com/astralhpi/cf-worker-memory-leak-sample

astralhpi avatar Sep 12 '25 09:09 astralhpi

Fantastic ! Do you have any idea for running the tests for Cloudflare Workers too?

porsager avatar Nov 12 '25 06:11 porsager