Commit df34e3e
committed
fix: use ESM imports for node:zlib instead of require()
The module uses 'type': "module" in package.json, so require() is not
available. Replace all require('zlib') calls with proper ESM imports
(createGunzip, createInflate, createBrotliDecompress, createUnzip).
This fixes #1063 more completely:
- The node_stream Transform import from previous commit fixes the
ReferenceError for uncompressed requests
- This commit fixes ReferenceError: require is not defined for
compressed requests (gzip, deflate, br, compress)1 parent 6f0295e commit df34e3e
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
| |||
262 | 268 | | |
263 | 269 | | |
264 | 270 | | |
265 | | - | |
| 271 | + | |
266 | 272 | | |
267 | 273 | | |
268 | | - | |
| 274 | + | |
269 | 275 | | |
270 | 276 | | |
271 | | - | |
| 277 | + | |
272 | 278 | | |
273 | 279 | | |
274 | | - | |
| 280 | + | |
275 | 281 | | |
276 | 282 | | |
277 | 283 | | |
| |||
0 commit comments