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

mode not set on dev and watch CLI commands #1971

Closed
6 tasks done
thebuilder opened this issue Sep 4, 2022 · 0 comments
Closed
6 tasks done

mode not set on dev and watch CLI commands #1971

thebuilder opened this issue Sep 4, 2022 · 0 comments

Comments

@thebuilder
Copy link

Describe the bug

Running the dev or watch CLI commands after upgrading to version 0.23.0 results in the following error:

TypeError: Cannot read properties of undefined (reading 'mode')
    at startVitest (file:///Frontend/node_modules/vitest/dist/chunk-vite-node-externalize.41bf722e.mjs:10588:57)
    at CAC.start (file:///Frontend/node_modules/vitest/dist/cli.mjs:676:15)
    at CAC.runMatchedCommand (file:///Frontend/node_modules/vitest/dist/cli.mjs:645:34)
    at CAC.parse (file:///Frontend/node_modules/vitest/dist/cli.mjs:572:12)
    at file:///Frontend/node_modules/vitest/dist/cli.mjs:659:5
    at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
    at async loadESM (node:internal/process/esm_loader:91:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)

It's most likely caused by #1029 adding the mode value as an extra parameter to the start method:
https://github.com/vitest-dev/vitest/pull/1029/files#diff-c322bc45ad914ffa25dc80a6918be23a154d9a5e28c7776c662fcb776b430f05R90

The start method is not called with mode when running these commands, but only cliFilters and options (that are then assigned to the wrong parameters).

Reproduction

Try running the following commands:

  • vitest dev
  • vitest watch

System Info

System:
    OS: macOS 12.5.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 167.63 MB / 16.00 GB
    Shell: 3.5.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.17.0 - /usr/local/bin/node
    Yarn: 3.2.1 - /usr/local/bin/yarn
    npm: 8.15.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 105.0.5195.52
    Firefox: 104.0.1
    Safari: 15.6.1
  npmPackages:
    @vitejs/plugin-react: ^2.0.1 => 2.0.1 
    vite: ^3.0.9 => 3.0.9 
    vitest: ^0.23.0 => 0.23.0

Used Package Manager

yarn

Validations

@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant