Repository navigation
Closed
Labels
e: wasmIssues related to the wasm build of Flutter Web.Issues related to the wasm build of Flutter Web.p: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issueteam-webOwned by Web platform teamOwned by Web platform team
Description
Steps to reproduce
- clone this repo
- run the trivial example via
flutter run -d chrome --web-port 42069 - sign in with google using the button / pop up flow
- everything works as intended
- close the application, and then re-run it...
- ... but this time, use
flutter run -d chrome --web-port 42069 --wasm - try the sign in with google flow
- the flow unexpectedly stops on the pop-up, which stays blank
Expected results
"Sign In with Google" to work with WASM effortlessly.
Actual results
the flow breaks or, rather, it stops entirely.
Code sample
Again, use this repo, which also contains web-platform related configurations, as mentioned in the docs.
Screenshots or Video
Logs
by using --wasm I'm not able to see any logs in the debug console, nor the debugger is actually there; so, debugging is quite painful (when possible).
luckily, the web console prints the following in the pop-up window:
Logs
m=transform_layer_library:228 Uncaught TypeError: Cannot read properties of null (reading 'postMessage')
lm @ m=transform_layer_library:228
mm @ m=transform_layer_library:228
_.rm.h @ m=transform_layer_library:230
Kq.h @ m=transform_layer_library:238
(anonymous) @ m=transform_layer_library:240
(anonymous) @ transform:1no other errors are mentioned there, or in the main window.
Flutter Doctor output
Doctor output
> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.38.1, on macOS 15.6.1 24G90 darwin-arm64, locale en-IT)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0-rc1)
[!] Xcode - develop for iOS and macOS (Xcode 26.2)
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
This can usually be fixed by re-installing CocoaPods.
For re-installation instructions, see https://guides.cocoapods.org/using/getting-started.html#installation
[✓] Chrome - develop for the web
[✓] Connected device (2 available)
! Error: Failed to prepare the device for development. Please unlock and reconnect the device. (code 806)
! Error: Browsing on the local area network for BEMDAPIS680. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
! Doctor found issues in 1 category.Notes
I would love to understand if:
- I did not understand the plugin configuration instructions
- We should walk an extra mile when it comes to WASM, but then it should be documented
- If there's any inner blocker about this issue and - if there is - how can I work around that
Metadata
Metadata
Assignees
Labels
e: wasmIssues related to the wasm build of Flutter Web.Issues related to the wasm build of Flutter Web.p: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyr: duplicateIssue is closed as a duplicate of an existing issueIssue is closed as a duplicate of an existing issueteam-webOwned by Web platform teamOwned by Web platform team

Activity
maRci002 commentedon Jan 9, 2026
Duplicate of firebase/flutterfire#12819
#180026 fixes that you just need to pass
--no-cross-origin-isolationin development mode (note: the fix hasn't landed on stable yet, so use master). This way the WASM will run in single threaded mode.If you want to use stable flutter then use #163479 (comment) workaround
darshankawar commentedon Jan 9, 2026
Thanks @maRci002
@lucavenir Please check above and see if it helps to resolve your case or not.
lucavenir commentedon Jan 11, 2026
@maRci002 thank you for the quick reply.
I can see there's a firebase related issue, so thank you; but this is about
google_sign_in(we're not using firebase ourselves). Is there any difference?To be clear (on stable), I receive this
Uncaught TypeError: Cannot read properties of nulleven with--release. Why did you specify about development mode?Yes, this works, both on debug and release modes. But I see this error message in the console:
Cross-Origin-Opener-Policy policy would block the window.postMessage call.is this intentional? Is there any side effect to it? Anyways, I still have doubts about this flag (see below).
This doesn't seem to work for me. I'm unable to make this workaround work on stable.
Is it possible to have documentation about this topic? Why would we need single threaded mode when signing in with google? I realize I'm ignorant, but I can't possibly be the only one stumbling on this without surprises.
Most importantly: are there any side effects to this? Are we giving up multi threading on WASM just to make Google Auth work? Did I get this right?
Again, I'm sorry if I'm asking dumb questions, but I re-read the linked threads and I can't honestly make much out of it.
darshankawar commentedon Jan 12, 2026
Keeping issue open and labeling for team's tracking.
maRci002 commentedon Jan 12, 2026
Sorry about the confusion. I believe these issues are related, since both Firebase Auth and
google_sign_inuse a popup-based authentication flow. When acrossOriginIsolatedenvironment is enabled, the popup window can no longer communicate with your Flutter app viawindow.postMessage, which causes this failure.Make sure to comment out the COOP / COEP headers and then regenerate
flutter_tools.snapshot.You can read more about this issue here:
firebase/firebase-js-sdk#6199
firebase/firebase-js-sdk#6467
Unfortunately, Google has full control over this behavior. Their authentication flow has not been updated to properly support COOP / COEP headers. As a result, you must run in a non-
crossOriginIsolatedenvironment, which meansSharedArrayBufferis unavailable. Because of that, WebAssembly cannot use multithreading, since threads rely onSharedArrayBufferfor communication.wreppun commentedon Jan 13, 2026
One thing I'm interested in, and I can't seem to find documented anywhere: what is the impact of running flutter (wasm) in single-threaded mode (vs multi-threaded mode)?
This info would be helpful, especially considering that the GIS popup window will not be changing behavior in the near (or medium) future.
maRci002 commentedon Jan 14, 2026
OffscreenCanvasto handle rasterization. In single-threaded mode, all rendering logic is moved to the main thread. This means rendering must compete for CPU time with your application logic and the browser's UI tasks, increasing the likelihood of "jank" if the main thread is busy.OffscreenCanvaswith WebGL (notably Safari) or for environments that aren'tcrossOriginIsolated(whereSharedArrayBufferis disabled).yjbanov commentedon Jan 14, 2026
Deduplicating into firebase/flutterfire#12819. This is a COOP/COEP issue.
lucavenir commentedon Jan 16, 2026
Since the other issues is now closed and locked, I reply in here @maRci002. This is not working. Here's what I'm doing, step by step:
First, I find out about my
flutterinstallation path:Then, I
cat [...]/web/web_constants.dartweb constants before editing
Then, I edit the file (e.g.
nano [...]/web/web_constants.dart) as shown.Then, I
cat [...]/web/web_constants.dartagain to check out the edits.web constants after my edits
I proceed to remove the cached snapshot:
rm [...]/mise/installs/flutter/3.38.6-stable/bin/cache/flutter_tools.snapshotThen,
flutter doctor.flutter doctor after the edits
Almost there; I open a new terminal session and spin up
chromedriverchome driver output
% chromedriver --port=4444 Starting ChromeDriver 143.0.7499.192 (be2c1f4fd451578a9ada68a0ac12d659362b44bf-refs/branch-heads/7499@{#4083}) on port 4444 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully on port 4444.Finally, I spin up the test via
... But the logs indicates
crossOriginIsolatedisfalse, and indeed the memory usage turns out to benullflutter driver output
The code is available here.
maRci002 commentedon Jan 16, 2026
It seems the patch is working as intended, since the COOP/COEP headers are no longer applied therefore
crossOriginIsolatedshould befalseand authentication should work. What does your console say—are there any errors?Remember, after applying the patch you can enable the COOP/COEP headers again at any time:
This also means the snapshot is being rebuilt.
I’m not sure whether Flutter Driver uses the same
ReleaseAssetServeras a running Flutter application.lucavenir commentedon Jan 19, 2026
Thank you ❤️ This is what I needed.
github-actions commentedon Feb 2, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.