Skip to content

fix: add explicit zlib constant fallbacks for esbuild-stripped values#26

Open
DawidMyslak wants to merge 1 commit intorivet-dev:mainfrom
DawidMyslak:fix/zlib-constants-fallbacks
Open

fix: add explicit zlib constant fallbacks for esbuild-stripped values#26
DawidMyslak wants to merge 1 commit intorivet-dev:mainfrom
DawidMyslak:fix/zlib-constants-fallbacks

Conversation

@DawidMyslak
Copy link

Summary

  • Packages like axios crash inside the V8 isolate with TypeError: Cannot read properties of undefined (reading 'Z_SYNC_FLUSH') because esbuild tree-shakes zlib constants out of the browserify-zlib bundle
  • Add explicit fallbacks for all standard zlib.h constants (flush, return codes, compression levels, strategies) matching the existing pattern for mode constants
  • Add comprehensive test asserting all 25 constants are present with correct values

Test plan

  • Existing zlib polyfill tests continue to pass
  • New zlib.constants has flush, return-code, level, and strategy constants test passes in CI
  • axios-pass project-matrix fixture passes

Made with Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant