There's a conflict with React Router ≥ v6.4.5, where it always expects a response to have a body property. However, the whatwg-fetch library used by pretender is intercepting the Response created by React Router and appending a _bodyInit property instead of a body property. So React Router checks this Response with a duck-typing check, sees that it doesn't have a body property (which the W3 spec requires of a Response obj), and rejects it as not being a valid Response.
(In v6.4.4 they were checking it with instanceof Request which was passing that check.)
My question is, why is this polyfilled fetch being used instead of the native fetch when my browser has a native fetch? The native fetch doesn't have this problem.
There's a conflict with React Router ≥ v6.4.5, where it always expects a response to have a
bodyproperty. However, thewhatwg-fetchlibrary used by pretender is intercepting theResponsecreated by React Router and appending a_bodyInitproperty instead of abodyproperty. So React Router checks this Response with a duck-typing check, sees that it doesn't have abodyproperty (which the W3 spec requires of a Response obj), and rejects it as not being a valid Response.(In v6.4.4 they were checking it with
instanceof Requestwhich was passing that check.)My question is, why is this polyfilled
fetchbeing used instead of the native fetch when my browser has a native fetch? The native fetch doesn't have this problem.