Type Error: response2.headers.all is not a function #1884
-
Hi I have started getting the error "Type Error: response2.headers.all is not a function" on all my mocks. They were working fine, but now they are all broken because of this. I have the exact same setup on another repo and it is working and has been working for a long time. Has anyone had this issue before and found a resolution? I am running an older version of MSW (1.2.1) but am not in a position to upgrade at this time. Any help appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello @markgeorgebg, I was having the same problem and noticed that the .all() method was removed from headers-polyfill [since version 3.3.0](https://github.com/mswjs/headers-polyfill/releases/tag/ v3.3.0 ). So I decided to install an older version as a development dependency and it seems to work fine now.
I hope it works for you too. Greetings! |
Beta Was this translation helpful? Give feedback.
-
I also had this issue with configuring new repo, keeping the same setup. In my case the issue was with |
Beta Was this translation helpful? Give feedback.
-
i saw node v16.4.2 (yeah i know...) axios: 1.7.4
msw: 1.1.0
vitest: 0.29.7
vite: 4.5.5 |
Beta Was this translation helpful? Give feedback.
Hello @markgeorgebg,
I was having the same problem and noticed that the .all() method was removed from headers-polyfill [since version 3.3.0](https://github.com/mswjs/headers-polyfill/releases/tag/ v3.3.0 ). So I decided to install an older version as a development dependency and it seems to work fine now.
npm i [email protected] -D
I hope it works for you too.
Greetings!