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

fetch响应body不是的ReadableStream:苹果端qq浏览器中 #47

Open
WThreeSix opened this issue Jun 13, 2023 · 5 comments
Open

fetch响应body不是的ReadableStream:苹果端qq浏览器中 #47

WThreeSix opened this issue Jun 13, 2023 · 5 comments

Comments

@WThreeSix
Copy link

在苹果端qq浏览器中会报错,看了下是fetch请求在这个浏览器中返回的response不一样,感觉回来的不是一个ReadableStream,没有body,但是有_bodyBlob和_bodyInit字段,响应回来的type是default,数据是一个blob的,然后这个组件读不到body报错了,这个问题怎么处理下可以在苹果端的qq浏览器中返回和其他浏览器一样的响应体ReadableStream

@NateYip
Copy link

NateYip commented Sep 12, 2023

同样的问题

@NateYip
Copy link

NateYip commented Sep 12, 2023

不只是苹果端 移动端貌似QQ浏览器都有问题

@Xuan-Yu-San
Copy link

在这些浏览器里,fetch都不是native code,而是polyfill。polyfill的fetch是用xhr模拟的,主流的xhr模拟是没有实现body的。如果想要的话需要自己实现,这个项目是支持自定义fetch传入的,实现后传进去就好。

@zyhui98
Copy link

zyhui98 commented Oct 13, 2023

使用node v18.14.1 , 就可用自带的fetch

node-fetch@3.3.2 ,竟然ReadableStream.getReader(),提示方法不存在,坑的很

@zhuxiwen
Copy link

在这些浏览器里,fetch都不是native code,而是polyfill。polyfill的fetch是用xhr模拟的,主流的xhr模拟是没有实现body的。如果想要的话需要自己实现,这个项目是支持自定义fetch传入的,实现后传进去就好。

谢谢,cv了你的代码,没问题了。:)
6edc0d6

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

5 participants