Skip to content

Getting a warning on Web: You are using an unsupported command-line flag: --no-sandbox. Stability and security will suffer. #175227

Closed

Description

@tirth-patel-nc

Steps to reproduce

  1. flutter channel master
  2. flutter upgrade
  3. flutter create counter_app
  4. flutter run -d chrome

It is a Regression. Replicable on latest master 3.37.0-1.0.pre-84. Works fine on 3.32.8 / 3.35.8. Bisected to #174685

Expected results

You are using an unsupported command-line flag: --no-sandbox. Stability and security will suffer. shouldn't come.

Actual results

You are using an unsupported command-line flag: --no-sandbox. Stability and security will suffer. warning appears.

Code sample

Code sample (Counter App)
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // TRY THIS: Try running your application with "flutter run". You'll see
        // the application has a purple toolbar. Then, without quitting the app,
        // try changing the seedColor in the colorScheme below to Colors.green
        // and then invoke "hot reload" (save your changes or press the "hot
        // reload" button in a Flutter-supported IDE, or press "r" if you used
        // the command line to start the app).
        //
        // Notice that the counter didn't reset back to zero; the application
        // state is not lost during the reload. To reset the state, use hot
        // restart instead.
        //
        // This works for code too, not just values: Most code changes can be
        // tested with just a hot reload.
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // TRY THIS: Try changing the color here to a specific color (to
        // Colors.amber, perhaps?) and trigger a hot reload to see the AppBar
        // change color while the other colors stay the same.
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          //
          // TRY THIS: Invoke "debug painting" (choose the "Toggle Debug Paint"
          // action in the IDE, or press "p" in the console), to see the
          // wireframe for each widget.
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text('You have pushed the button this many times:'),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Image

Logs

Logs
N/A

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.37.0-1.0.pre-84, on macOS 15.6.1 24G90 darwin-arm64, locale en-IN) [2.1s]
    • Flutter version 3.37.0-1.0.pre-84 on channel master at /Users/tirthpatel/Development/flutter_master/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c35c37a6df (3 hours ago), 2025-09-11 03:57:15 -0400
    • Engine revision c35c37a6df
    • Dart version 3.10.0 (build 3.10.0-188.0.dev)
    • DevTools version 2.50.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, enable-custom-devices,
      cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [3.7s]
    • Android SDK at /Users/tirthpatel/Library/Android/sdk
    • Emulator version 36.1.9.0 (build_id 13823996) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [985ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [8ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (2 available) [6.2s]
    • macOS (desktop) • macos  • darwin-arm64   • macOS 15.6.1 24G90 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 140.0.7339.133

[✓] Network resources [457ms]
    • All expected network resources are available.

• No issues found!

Activity

  1. added
    c: regressionIt was better in the past than it is now
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-webWeb applications specifically
    a: buildBuilding flutter applications with the tool
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-webOwned by Web platform team
    on Sep 11, 2025
  2. changed the title [-]Getting a warning on Web: You are using an unsupported command-line flag: --no-sandbox. Stability and security will suffer[/-] [+]Getting a warning on Web: `You are using an unsupported command-line flag: --no-sandbox. Stability and security will suffer.`[/+] on Sep 11, 2025
  3. nshahan commented on Sep 24, 2025

    @nshahan
    Contributor

    I agree that this is a distracting regression when developing a Flutter Web application. It was introduced by #174685 for the stated reason that tests started failing because they were being run in an environment that didn't support the sandboxed mode.

    It think a better solution would be to update the test infra to pass the --no-sandbox flag when needed and regular invocations of flutter run -d chrome should not.

  4. biggs0125 commented on Sep 25, 2025

    @biggs0125
    Contributor
  5. bkonyi commented on Sep 25, 2025

    @bkonyi
    Contributor

    @mosuem, looking at #174685 I'm not sure why we needed to start passing --no-sandbox, even outside of headless mode. Is this actually necessary? The original issue (#165664) was fixed in a separate PR.

  6. mosuem commented on Oct 9, 2025

    @mosuem
    Contributor

    It did make some chrome tests pass, which were failing on a permissions issue, IIRC.

  7. added
    P2Important issues not at the top of the work list
    triaged-webTriaged by Web platform team
    on Oct 22, 2025
  8. PearGod commented on Nov 16, 2025

    @PearGod

    What is the modification to the command flutter run -d chrome that will work around this in the local deployment? Is there an alternative approach to correct this issue in VS Code?

  9. github-actions commented on Dec 11, 2025

    @github-actions

    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 -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolbrowser: chrome-desktoponly manifests in desktop Chromec: regressionIt was better in the past than it is nowfound in release: 3.37Found to occur in 3.37has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions