sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.27k stars 935 forks source link

BUG?? #1777

Closed andress134 closed 3 years ago

andress134 commented 3 years ago

Describe the bug

Actual behavior

...

Expected behavior

/root/node_modules/got/dist/source/core/index.js:1346 this[kRequest].emit('upload-complete'); TypeError: Cannot read property 'emit' of undefined

Code to reproduce

...

Checklist

phawxby commented 1 year ago

@szmarczak we're having the same issue with V11.8.5 and I think it might be related to usage of msw. I notice the code is different between V11 and V12, is that due to a bug being patched or general refactoring?

    TypeError: Cannot read properties of undefined (reading 'emit')

      at node_modules/got/dist/source/core/index.js:1364:36
      at node_modules/@mswjs/interceptors/src/interceptors/ClientRequest/NodeClientRequest.ts:172:9

I'd love to move our project over to ESM and upgrade got to see but sadly the trigger on that has been pulled far too early to be feasible for us.

szmarczak commented 1 year ago

@phawxby What's the code behind line 1364 (in 11.8.5 it's just a bracket)?