79630810

Date: 2025-05-20 16:23:09
Score: 0.5
Natty:
Report link

How to Set CHROME_EXECUTABLE in VS Code for Dart/Flutter Development

Problem

The Dart/Flutter extension in VS Code couldn’t detect Chrome, even after setting CHROME_EXECUTABLE in the system environment variables or shell config (e.g., .bashrc or .zshrc).

Solution

To ensure the Dart extension recognizes Chrome, add CHROME_EXECUTABLE directly to VS Code’s Dart-specific environment settings:

  1. Open VS Code Settings (Ctrl + , or Cmd + ,).

  2. Search for "dart.env".

  3. Click "Edit in settings.json".

  4. Add the following configuration:

    {
      "dart.env": {
        "CHROME_EXECUTABLE": "/opt/google/chrome/chrome" 
      }
    }
    

    Replace /opt/google/chrome/chrome with your Chrome path if different (e.g., /usr/bin/google-chrome on some Linux systems).

  5. Restart VS Code for changes to take effect.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): How to
  • Low reputation (1):
Posted by: Badri