devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Embedded DevTools views fail to load in VS code with WASM enabled

Open kenzieschmoll opened this issue 7 months ago • 1 comments

This is not consistently reproducible, but happens occasionally.

Repro steps (that may work):

  1. Switch to the latest flutter main channel
  2. Open DevTools to turn on the experimental wasm setting. Run dart devtools, open the settings menu, and enable wasm. This setting will persist for you.
  3. Close DevTools.
  4. Open a Flutter project in VS code (ensure you have the latest VS code)
  5. Open the Flutter VS code Sidebar
flutter_bootstrap.js:121 Attempting to load DevTools with skwasm renderer.
skwasm.js:33 Uncaught (in promise) DataCloneError: Failed to execute 'postMessage' on 'Worker': SharedArrayBuffer transfer requires self.crossOriginIsolated.
    at skwasm.js:33:213
    at new Promise (<anonymous>)
    at Xe (skwasm.js:32:11)
    at Array.map (<anonymous>)
    at hf (skwasm.js:33:290)
    at skwasm.js:30:360
    at skwasm.js:34:25
    at Array.forEach (<anonymous>)
    at nf (skwasm.js:34:14)
    at zg (skwasm.js:148:184)

@eyebrowsoffire @biggs0125 @DanTup

kenzieschmoll avatar Apr 08 '25 16:04 kenzieschmoll

Looks like VS Code may not be ready for Skwasm's multi-threaded mode? (cross origin isolation is behind a flag --enable-coi).

That said, after https://github.com/flutter/flutter/pull/164748, Skwasm should switch dynamically to single-threaded mode in situations like this. When was the last time you got this error?

cc @eyebrowsoffire to correct me if I'm wrong or if he wants to add something.

mdebbar avatar Jun 25 '25 16:06 mdebbar

@elliette to investigate if these are still happening

kevmoo avatar Aug 13 '25 21:08 kevmoo

I have not encountered this since earlier this year, therefore closing. Will re-open if it happens again.

elliette avatar Aug 14 '25 18:08 elliette