web icon indicating copy to clipboard operation
web copied to clipboard

[Bug]: Error sending packet 704992908 ReferenceError: SharedArrayBuffer is not defined

Open ch3p4ll3 opened this issue 9 months ago • 19 comments

Before submitting

  • [x] I have searched existing issues to make sure this bug hasn't already been reported
  • [x] I have updated to the latest version of the software to verify the issue still exists
  • [x] I have cleared cache/cookies/storage or tried in a private/incognito window (if applicable)

Hardware

Rak4631

Connection Type

Bluetooth

Local or Hosted

https://client.meshtastic.org

Firmware Version

2.6.1.7c3edde

Operating System

Windows 11

Browser

Edge 134.0.3124.72 & Chrome 134.0.6998.89

Expected Behavior

Bluetooth connections works

Actual Behavior

I'm getting a console error when trying to connect to nodes using bluetooth.

UI not loading and I'm unable to use the node in the web client.

Steps to Reproduce

  1. Click New Connection
  2. Click Bluetooth
  3. Click New Device
  4. Select the device from the browser modal and click Pair
  5. Click on the new UI button for that device

Relevant console output

index-iVSvOqO1.js:512 Error sending packet 504699740 ReferenceError: SharedArrayBuffer is not defined
    at pF (index-iVSvOqO1.js:512:43959)
    at vF.writeToRadio (index-iVSvOqO1.js:512:65124)
    at index-iVSvOqO1.js:512:49189
    at mF.processQueue (index-iVSvOqO1.js:512:45454)
    at async vF.sendRaw (index-iVSvOqO1.js:512:49138)

Screenshots

Image

Additional Context

No response

ch3p4ll3 avatar Mar 18 '25 14:03 ch3p4ll3

@ch3p4ll3 can you please confirm that you've cleared your cache and retried? This has been fixed but requires clearing the cache.

Hunter275 avatar Mar 18 '25 14:03 Hunter275

As well please try using the https://client.meshtastic.org website in a incognito tab.

danditomaso avatar Mar 18 '25 14:03 danditomaso

I tried using incognito mode and it worked, but only for the first connection, after an F5 the page refreshed and the error recurred and until I clear the cache again it does not work

ch3p4ll3 avatar Mar 18 '25 15:03 ch3p4ll3

@ch3p4ll3

Use Shift+F5 and see if that fixes it.

Hunter275 avatar Mar 19 '25 02:03 Hunter275

@Hunter275 Yep, Shift+F5 fixes the problem, but still, if I close the tab and open it again without clearing the site cache it doesn't work

ch3p4ll3 avatar Mar 19 '25 07:03 ch3p4ll3

@ch3p4ll3 Can I ask you try this preview deployment of the Mestastic client? https://web-nt9s8cck3-meshtastic.vercel.app/

Let us know if it fixes your issue, additionally one other step I'd like you to try is opening your Chrome DevTools, selecting the Application Tab, then going to Service Workers. If you see anything in the right pane, select the hyperlink named "Unregister". After refreshing your browser (or closing it entirely) you shouldn't have issues with Bluetooth connections.

danditomaso avatar Mar 19 '25 17:03 danditomaso

I tried the preview version and the problem persists, even removing the service worker doesn't work

ch3p4ll3 avatar Mar 19 '25 18:03 ch3p4ll3

  • I tried again but the problem is not solved, I always have to delete the site data before I can connect

ch3p4ll3 avatar Mar 21 '25 14:03 ch3p4ll3

I’m experiencing the same issue, I got SharedArrayBuffer error when trying to connect via Bluetooth. I’ve tested this on both my LilyGO T-Beam and SenseCAP T1000-E devices. After clearing the browser cache, the first connection attempt works fine. However, when I try to connect a second time, the error appears again and the connection fails like #489

lodos2005 avatar May 02 '25 20:05 lodos2005

And with the last release I get this error on google Chrome: Uncaught (in promise) TypeError: navigator.bluetooth.getDevices is not a function

Image

ch3p4ll3 avatar May 05 '25 14:05 ch3p4ll3

Noticing that when this happens, the main html doc shows "200 OK (from service worker)" in the dev tools network viewer's Header tab. When I force refresh, it doesn't mention the service worker and the cross-origin-opener-policy and cross-origin-embedder-policy headers show properly set. Maybe something with the service worker is the issue?

jwarchol avatar May 21 '25 13:05 jwarchol

This should be retested using the latest webUI as PR #638 and another related PR were recently merged.

danditomaso avatar Jun 12 '25 15:06 danditomaso

Noticing that when this happens, the main html doc shows "200 OK (from service worker)" in the dev tools network viewer's Header tab. When I force refresh, it doesn't mention the service worker and the cross-origin-opener-policy and cross-origin-embedder-policy headers show properly set. Maybe something with the service worker is the issue?

Thanks for mentioning this, I've seen the same google results I believe you are mentioning and in our vite.config.ts file we have all relevant headers being set. Please retest with the latest version of the web client.

danditomaso avatar Jun 12 '25 15:06 danditomaso

This should be retested using the latest webUI as PR #638 and another related PR were recently merged.

Hi, I tried the latest webUI but nothing changed, I also tried force-refresh, cleaning site data and remove service worker but nope. This is what I get when I click the bluetooth button

Image

ch3p4ll3 avatar Jun 13 '25 08:06 ch3p4ll3

@ch3p4ll3 Can you access https://client-test.meshtastic.org and see if the issue still occurs on that web host? This can be a tough to duplicate issue as it doesn't occur on my set up but I know others have experienced it.

danditomaso avatar Jul 02 '25 12:07 danditomaso

@ch3p4ll3 Can you access https://client-test.meshtastic.org and see if the issue still occurs on that web host? This can be a tough to duplicate issue as it doesn't occur on my set up but I know others have experienced it.

hello, I have tried in both clients, even doing shift+f5 but the problem persists:

Image

ch3p4ll3 avatar Jul 02 '25 20:07 ch3p4ll3

I had the exact same issues and traced it to the configuration of Cross-Origin-Embedder-Policy / Cross-Origin-Opener-Policy headers, which seem to prevent access to the SharedArrayBuffer.

https://client-test.meshtastic.org/ is working fine for me. The GATT Server error was logged once but disappeared and never returned after a simple refresh. Now I can simply refresh the page (F5) and connect again and again. ✅

Some translations are missing, but I think this is fine for testing. I was switching to English to work around that.

alex-vg avatar Jul 17 '25 20:07 alex-vg

I tried again but on Windows 11 both on Chrome and Edge I always have the same error: Uncaught (in promise) TypeError: navigator.bluetooth.getDevices is not a function

ch3p4ll3 avatar Jul 21 '25 13:07 ch3p4ll3

web-nt9s8cck3-meshtastic.vercel.app was able to resolve the issue for me on Chrome with a RAK 4631 WisBlock

I stand corrected, it reappears if you disconnect and try to reconnect

michaelpeterswa avatar Sep 02 '25 17:09 michaelpeterswa