···95959696## Configuration
97979898-To activate browser mode in your Vitest configuration, you can use the `--browser=name` flag or set the `browser.enabled` field to `true` in your Vitest configuration file. Here is an example configuration using the browser field:
9898+To activate browser mode in your Vitest configuration, set the `browser.enabled` field to `true` in your Vitest configuration file. Here is an example configuration using the browser field:
9999100100```ts [vitest.config.ts]
101101import { defineConfig } from 'vitest/config'
···327327To specify a browser using the CLI, use the `--browser` flag followed by the browser name, like this:
328328329329```sh
330330-npx vitest --browser=chrome
330330+npx vitest --browser=chromium
331331```
332332333333Or you can provide browser options to CLI with dot notation:
···335335```sh
336336npx vitest --browser.headless
337337```
338338+339339+::: warning
340340+Since Vitest 3.2, if you don't have the `browser` option in your config but specify the `--browser` flag, Vitest will fail because it can't assume that config is meant for the browser and not Node.js tests.
341341+:::
338342339343By default, Vitest will automatically open the browser UI for development. Your tests will run inside an iframe in the center. You can configure the viewport by selecting the preferred dimensions, calling `page.viewport` inside the test, or setting default values in [the config](/config/#browser-viewport).
340344