# Problems with .stream() v3 - workers/polyfills?

**URL:** <https://improve.xmtp.org/t/problems-with-stream-v3-workers-polyfills/884>\
**Category:** General Discussion\
**Created:** [March 4, 2025, 10:19am UTC](https://improve.xmtp.org/t/problems-with-stream-v3-workers-polyfills/884 "2025-03-04T10:19:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![technohippies](https://improve.xmtp.org/user_avatar/improve.xmtp.org/technohippies/32/1015_2.png) [@technohippies](https://improve.xmtp.org/u/technohippies)\
**Post date:** [March 4, 2025, 10:19am UTC](https://improve.xmtp.org/t/problems-with-stream-v3-workers-polyfills/884/1 "2025-03-04T10:19:07Z")

</div>

Hey there,

V3 is a huge update, nice! I’m having problems with the Worker in the v3 version. I can send/receive about 5-10 messages, and then I routinely get errors from the Worker, which I believe is the stream listener.

I had to ask AI to help me setup the polyfills too, it wasn’t as simple as before.

I’m getting errors like:

```auto
index.js?v=73adc55f:1 Uncaught Error: expected `,` or `}` at line 1 column 20459
    at Worker.s (index.js?v=73adc55f:1:2076)
s @ index.js?v=73adc55f:1
index.js?v=73adc55f:1 Uncaught Error: expected `,` or `}` at line 1 column 21991
    at Worker.s (index.js?v=73adc55f:1:2076)
s @ index.js?v=73adc55f:1
2index.js?v=73adc55f:1 Uncaught Error: expected `,` or `}` at line 1 column 4093
    at Worker.s (index.js?v=73adc55f:1:2076)
s @ index.js?v=73adc55f:1
index.js?v=73adc55f:1 Uncaught Error: expected `,` or `}` at line 1 column 21991
    at Worker.s (index.js?v=73adc55f:1:2076)
s @ index.js?v=73adc55f:1
index.js?v=73adc55f:1 Uncaught Error: expected `,` or `}` at line 1 column 20459
    at Worker.s (index.js?v=73adc55f:1:2076)

```

Which I’m not sure how to debug. My code is on Github, but messy and I had AI try to help me debug this problem.

[https://github.com/technohippies/scarlett\_vite](https://github.com/technohippies/scarlett_vite)

It would be very useful to have a working XMTP demo that uses Vite v6 because it wasn’t easy getting v3 working.

Any help is much appreciated. Thank you.

---

<div class="post-metadata">

**Author:** ![technohippies](https://improve.xmtp.org/user_avatar/improve.xmtp.org/technohippies/32/1015_2.png) [@technohippies](https://improve.xmtp.org/u/technohippies)\
**Post date:** [March 4, 2025, 10:22am UTC](https://improve.xmtp.org/t/problems-with-stream-v3-workers-polyfills/884/2 "2025-03-04T10:22:49Z")

</div>

To be clear, it works for a 5-10 messages, and then breaks. Not sure why.

---

<div class="post-metadata">

**Author:** ![technohippies](https://improve.xmtp.org/user_avatar/improve.xmtp.org/technohippies/32/1015_2.png) [@technohippies](https://improve.xmtp.org/u/technohippies)\
**Post date:** [March 4, 2025, 12:27pm UTC](https://improve.xmtp.org/t/problems-with-stream-v3-workers-polyfills/884/3 "2025-03-04T12:27:57Z")

</div>

I’m eagerly awaiting this : [https://github.com/xmtp/xmtp-js/blob/main/sdks/browser-sdk/TBD](https://github.com/xmtp/xmtp-js/blob/main/sdks/browser-sdk/TBD)

I’m guessing there’s some polyfills that I’m not really sure how to configure properly

---

<div class="post-metadata">

**Author:** ![technohippies](https://improve.xmtp.org/user_avatar/improve.xmtp.org/technohippies/32/1015_2.png) [@technohippies](https://improve.xmtp.org/u/technohippies)\
**Post date:** [March 4, 2025, 1:11pm UTC](https://improve.xmtp.org/t/problems-with-stream-v3-workers-polyfills/884/4 "2025-03-04T13:11:47Z")

</div>

I created a skeletal auth + xmtp project, and it’s clear, the SDK’s workers depend on buffer and protobuf, which is not obvious how to use in a browser

Seems like my crazy shims got it to partially work, but in my skeletal example, it’s still an issue

Long story short, if you have a browser boilerplate that addresses this, it would be much appreciated. I’m blocked at this point

---

<div class="post-metadata">

**Author:** ![insi](https://improve.xmtp.org/user_avatar/improve.xmtp.org/insi/32/724_2.png) [@insi](https://improve.xmtp.org/u/insi)\
**Post date:** [March 4, 2025, 5:29pm UTC](https://improve.xmtp.org/t/problems-with-stream-v3-workers-polyfills/884/5 "2025-03-04T17:29:17Z")

</div>

Hello! thanks for the report. Responded in the github issue: [Bug: Polyfill Problems in XMTP v3 · Issue #857 · xmtp/xmtp-js · GitHub](https://github.com/xmtp/xmtp-js/issues/857#issuecomment-2698412505)
