wallabyjs / public

Repository for Wallaby.js questions and issues
http://wallabyjs.com
759 stars 45 forks source link

Automatic Vitest configuration error: The "path" argument must be of type string. Received undefined #3363

Closed tomitrescak closed 6 months ago

tomitrescak commented 6 months ago

Issue description or question

Running with automated detection on my vitest project. The wallaby fails to run with the following error:

‌[Error] Automatic Jest configuration error: Module jest-cli is not found in '.'. 
[Error]  
[Error] We've also tried to automatically configure Wallaby.js for other frameworks 
[Error] Automatic Vitest configuration error: The "path" argument must be of type string. Received undefined 

This is the repository:

https://github.com/WesternSydneyUniversity/course-full-stack-development-gtd-react

Wallaby diagnostics report

{
  editorVersion: '1.88.1',
  pluginVersion: '1.0.376',
  editorType: 'VSCode',
  osVersion: 'darwin 23.4.0',
  nodeVersion: 'v21.7.2',
  coreVersion: '1.0.1500',
  checksum: 'ZTk4NjZhZWJhMmJiMDkxZDc4NDU3MzM4NmM5N2JiNDMsMTcwMDA5MjgwMDAwMCww',
  config: { tests: [], files: [] },
  packageJSON: {
    dependencies: {
      '@auth/prisma-adapter': '^1.4.0',
      '@prisma/client': '^5.10.2',
      '@t3-oss/env-nextjs': '^0.9.2',
      '@tanstack/react-query': '^5.25.0',
      '@trpc/client': 'next',
      '@trpc/next': 'next',
      '@trpc/react-query': 'next',
      '@trpc/server': 'next',
      next: '^14.2.1',
      'next-auth': '^4.24.6',
      react: '19.0.0-canary-657428a9e-20240416',
      'react-dom': '19.0.0-canary-657428a9e-20240416',
      'server-only': '^0.0.1',
      superjson: '^2.2.1',
      zod: '^3.22.4'
    },
    devDependencies: {
      '@testing-library/jest-dom': '^6.4.2',
      '@testing-library/react': '^15.0.2',
      '@testing-library/user-event': '^14.5.2',
      '@types/eslint': '^8.56.2',
      '@types/jest': '^29.5.12',
      '@types/node': '^20.11.20',
      '@types/react': '^18.2.57',
      '@types/react-dom': '^18.2.19',
      '@typescript-eslint/eslint-plugin': '^7.1.1',
      '@typescript-eslint/parser': '^7.1.1',
      '@vitejs/plugin-react-swc': '^3.6.0',
      eslint: '^8.57.0',
      'eslint-config-next': '^14.1.3',
      jsdom: '^24.0.0',
      prisma: '^5.10.2',
      typescript: '^5.4.2',
      vite: '^5.2.9',
      'vite-tsconfig-paths': '^4.3.2',
      vitest: '^1.5.0',
      'vitest-mock-extended': '^1.3.1',
      msw: '^2.2.14',
      'msw-trpc': '2.0.0-beta.0'
    }
  },
  fs: { numberOfFiles: 0 },
  debug: [
    '2024-04-24T03:22:19.967Z project waiting for initial run signal\n',
    '2024-04-24T03:22:19.973Z config Attempting automatic configuration for angular\n',
    '2024-04-24T03:22:19.976Z angular/cli config Angular CLI not found.\n',
    '2024-04-24T03:22:19.976Z config Finished attempting automatic configuration for angular (3ms)\n',
    '2024-04-24T03:22:19.976Z config Attempting automatic configuration for jest\n',
    "2024-04-24T03:22:19.976Z jest/config Error: Module jest-cli is not found in '<homeDir>/Github/WSU/Full-Stack-Course-GTD/Exercise 2'.\n" +
      '    at Object.loadJest (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:496:1070)\n' +
      '    at n (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:184:23421)\n' +
      '    at Object.configure (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:184:26531)\n' +
      '    at automaticConfigurationProviders.reduce.Promise.resolve.success (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:132:12207)\n' +
      '    at async automaticConfigurationProviders.reduce.Promise.resolve.success (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:132:12084)\n' +
      '    at async Config.load (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:132:12024)\n',
    '2024-04-24T03:22:19.976Z config Finished attempting automatic configuration for jest (0ms)\n',
    '2024-04-24T03:22:19.976Z config Attempting automatic configuration for vitest\n',
    '2024-04-24T03:22:19.978Z vitest/config Detected Vitest (1.5.0).\n',
    '2024-04-24T03:22:20.065Z vitest/config Error: The "path" argument must be of type string. Received undefined\n' +
      '    at Object.configure (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:185:2625)\n' +
      '    at async automaticConfigurationProviders.reduce.Promise.resolve.success (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:132:12199)\n' +
      '    at async Config.load (<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.376/wallaby0919be/server.js:132:12024)\n',
    '2024-04-24T03:22:20.065Z config Finished attempting automatic configuration for vitest (89ms)\n'
  ]
}
NikGovorov commented 6 months ago

We've tried to run Wallaby in your repository, and everything is working for us.

The version of Wallaby that you are using was released 6 months ago, and there have been a number of breaking changes to vitest since then that have required updates to Wallaby; we think your problem is a result of an incompatible vitest version.

Can you please update Wallaby core to the latest version, we think it will fix your problem. If your license has expired, you may request a trial license to confirm it fixes your issue.

tomitrescak commented 6 months ago

Thank, with the update it works.