Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser Mode doesn't work #7358

Open
6 tasks done
LostKobrakai opened this issue Jan 24, 2025 · 1 comment
Open
6 tasks done

Browser Mode doesn't work #7358

LostKobrakai opened this issue Jan 24, 2025 · 1 comment

Comments

@LostKobrakai
Copy link

LostKobrakai commented Jan 24, 2025

Describe the bug

When running
npx vitest run

Error: Cannot define a nested project for a chrome browser. The project name "chrome" was already defined. If you have multiple instances for the same browser, make sure to define a custom "name". All projects in a workspace should have unique names. Make sure your configuration is correct.

config:

 test: {
      // globals: true,
      // setupFiles: ["node_modules/@testing-library/jest-dom/vitest"],
      // if you have few tests, try commenting this
      // out to improve performance:
      isolate: false,
      coverage: {
        provider: "istanbul", // or 'v8'
        enabled: true,
        reporter: ["html"],
        include: ["js/*", "js/**"],
        exclude: ["js/storybook.js"],
      },
      browser: {
        enabled: true,
        provider: "webdriverio",
        headless: true,
        instances: [{ browser: "chrome" }],
      },
    }

I'm not using workspaces. Also the project name is whatever I put as name of the browser instance - the function simply seems to be called multiple times, by definitions putting the same key in the set names set twice.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-91sxljov?file=vite.config.ts seems to be related to the solid plugin, without the plugin things work.

System Info

System:
    OS: macOS 15.1.1
    CPU: (14) arm64 Apple M4 Pro
    Memory: 1.70 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.1 - ~/.local/share/mise/installs/node/20.13.1/bin/node
    npm: 10.5.2 - ~/.local/share/mise/installs/node/20.13.1/bin/npm
  Browsers:
    Chrome: 131.0.6778.265
    Safari: 18.1.1
  npmPackages:
    @vitest/browser: 3.0.x => 3.0.4
    @vitest/coverage-istanbul: 3.0.x => 3.0.4
    vite: 6.0.x => 6.0.11
    vitest: 3.0.x => 3.0.4

Used Package Manager

npm

Validations

Copy link

Hello @LostKobrakai. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants