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

TypeError: Cannot convert undefined or null to object #566

Open
jiaopengzi opened this issue Jan 1, 2025 · 0 comments
Open

TypeError: Cannot convert undefined or null to object #566

jiaopengzi opened this issue Jan 1, 2025 · 0 comments

Comments

@jiaopengzi
Copy link

Describe the bug

After pnpm i open the vscode editor

I have reviewed the historical issues, and issue #329 appears to be similar. I have provided the minimal reproducible code for reference.

In my case, when Inspect is configured in vite.config.ts, vitest vscode fails to run and start properly. The error message in the bottom right corner states, "There was an error during Vitest startup. Check the output for more details."

However, when Inspect is commented out, vitest vscode works fine.

I have also tried adding content to the exclude directories, but it was unsuccessful.

Reproduction

repo:https://github.com/jiaopengzi/vitest-dev-vscode-issue

version: 1.96.2 (system setup)
commit: fabdb6a30b49f79a7aba0f2ad9df9b399473380f
date: 2024-12-19T10:22:47.216Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631

Output

**the vitest oupput**


[INFO 19:59:01] [v1.8.5] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 19:59:01] [API] Running Vitest v2.1.8 (vitest-dev-vscode-issue/vitest.config.ts) with Node.js@: C:\ToolPortable\Nodejs\nodejs\node.EXE 
[Error 19:59:03] [Error Error] Vitest failed to start: 
TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at configureServer (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected][email protected][email protected]_@[email protected]_/node_modules/vite-plugin-inspect/dist/shared/vite-plugin-inspect.UaceC5Dq.mjs:1408:12)
    at configureServer (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected][email protected][email protected]_@[email protected]_/node_modules/vite-plugin-inspect/dist/shared/vite-plugin-inspect.UaceC5Dq.mjs:1494:19)
    at _createServer (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:63080:26)
    at async createViteServer (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vitest/dist/chunks/cli-api.C2yC_ESk.js:9822:18)
    at async Module.createVitest (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vitest/dist/chunks/cli-api.C2yC_ESk.js:11441:18)
    at async Po (C:\Users\test\.vscode\extensions\vitest.explorer-1.8.5\dist\worker.js:21:8420)
    at async process.e (C:\Users\test\.vscode\extensions\vitest.explorer-1.8.5\dist\worker.js:21:9978)
Error: Vitest failed to start: 
TypeError: Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at configureServer (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected][email protected][email protected]_@[email protected]_/node_modules/vite-plugin-inspect/dist/shared/vite-plugin-inspect.UaceC5Dq.mjs:1408:12)
    at configureServer (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected][email protected][email protected]_@[email protected]_/node_modules/vite-plugin-inspect/dist/shared/vite-plugin-inspect.UaceC5Dq.mjs:1494:19)
    at _createServer (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:63080:26)
    at async createViteServer (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vitest/dist/chunks/cli-api.C2yC_ESk.js:9822:18)
    at async Module.createVitest (file:///C:/Desktop/vitest-dev-vscode-issue/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/vitest/dist/chunks/cli-api.C2yC_ESk.js:11441:18)
    at async Po (C:\Users\test\.vscode\extensions\vitest.explorer-1.8.5\dist\worker.js:21:8420)
    at async process.e (C:\Users\test\.vscode\extensions\vitest.explorer-1.8.5\dist\worker.js:21:9978)
    at ChildProcess.p (C:\Users\test\.vscode\extensions\vitest.explorer-1.8.5\dist\extension.js:20:3607)
    at ChildProcess.emit (node:events:518:28)
    at emit (node:internal/child_process:950:14)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)


### Extension Version

1.8.5

### Vitest Version

2.1.8

### Validations

- [X] Check that you are using the latest version of the extension
- [X] Check that there isn't [already an issue](https://github.com/vitest-dev/vscode/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitest-dev/vscode/discussions) or join our [Discord Chat Server](https://chat.vitest.dev).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
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

1 participant