Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interference between Pretender and React Server Components #360

Open
thearnica opened this issue Feb 25, 2023 · 1 comment
Open

Interference between Pretender and React Server Components #360

thearnica opened this issue Feb 25, 2023 · 1 comment

Comments

@thearnica
Copy link

Just want to report an issue I found during Next13 adoption - it short navigation between pages is not working.

The problem appears as TypeError: Cannot read properties of undefined (reading 'getReader') at react-server-dom-webpack-client.development.js

Root cause is at startReadingFromStream(response, r.body); with r being Response defined by pretender and .body being not defined.

In short - the underlaying polyfill does not support .body and likely will never support it - JakeChampion/fetch#1109

This basically means that the problem cannot be resolved in the downstream and might need correction at the pretender level. Why do you need FakeFetch in any case?

@bobziroll
Copy link

I'm experiencing a similar problem in React Router ≥v6.4.5. They changed their code to check the response for a body property that's not undefined. Previously, they only checked if the response was an instance of Response which passed, but pretender is returning a response with no body at all, and it's short-circuiting the navigation.

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

No branches or pull requests

2 participants