wallabyjs / public

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

Wallaby stopped running - "invalid type" error #3332

Closed kyeckeq closed 7 months ago

kyeckeq commented 7 months ago

Issue description or question

Need assistance getting Wallaby running in a VS Code project (Next.js/Jest). Wallaby was running fine, but recently stopped with an "invalid type: map" error and I have been unable to get it working again. All of the code/configuration is under source control and my coworker does not have this issue. We compared diagnostics reports and there are a couple differences (eg. his "modularizeImports" setting is undefined and "hasServerComponents" is true). I cannot find where the differeneces are getting picked up from or how to change them (to see if that would resolve the error). I've tried clearing the cache (Jest and Wallaby), reinstalling Wallaby, etc. to no avail. Any assistance would be appreciated!

Wallaby diagnostics report

{
  editorVersion: '1.86.1',
  pluginVersion: '1.0.371',
  editorType: 'VSCode',
  osVersion: 'win32 10.0.22631',
  nodeVersion: 'v18.19.0',
  coreVersion: '1.0.1525',
  checksum: 'ZDAyMjA1YmVhOTdhNWI5MTk3MDNjY2FkYWEwZDIyNWMsMTcyMDQ4MzIwMDAwMCww',
  config: {
    diagnostics: {
      jest: {
        config: {
          configs: [
            {
              automock: false,
              cache: true,
              cacheDirectory: 'z:\\temp\\jest',
              clearMocks: false,
              coveragePathIgnorePatterns: [ '\\\\node_modules\\\\' ],
              cwd: '<homedir>',
              dependencyExtractor: undefined,
              detectLeaks: false,
              detectOpenHandles: false,
              displayName: undefined,
              errorOnDeprecated: false,
              extensionsToTreatAsEsm: [],
              fakeTimers: { enableGlobally: false },
              filter: undefined,
              forceCoverageMatch: [],
              globalSetup: undefined,
              globalTeardown: undefined,
              globals: {},
              haste: { computeSha1: false, enableSymlinks: false, forceNodeFilesystemAPI: true, throwOnModuleCollision: false },
              id: 'be860898fd7fd64e7d5aa4d15c9de46a',
              injectGlobals: true,
              moduleDirectories: [ 'node_modules', 'src/common', 'src', 'C:/bayeq/repos/bayeq-git/BayEq.Cloud/BayEq.Cloud.Web' ],
              moduleFileExtensions: [
                'js',   'mjs',
                'cjs',  'jsx',
                'ts',   'tsx',
                'json', 'node'
              ],
              moduleNameMapper: [
                [ '^.+\\.module\\.(css|sass|scss)$', '<homedir>\\node_modules\\next\\dist\\build\\jest\\object-proxy.js' ],
                [ '^.+\\.(css|sass|scss)$', '<homedir>\\node_modules\\next\\dist\\build\\jest\\__mocks__\\styleMock.js' ],
                [ '^.+\\.(png|jpg|jpeg|gif|webp|avif|ico|bmp)$', '<homedir>\\node_modules\\next\\dist\\build\\jest\\__mocks__\\fileMock.js' ],
                [ '^.+\\.(svg)$', '<homedir>\\node_modules\\next\\dist\\build\\jest\\__mocks__\\fileMock.js' ],
                [ '@next/font/(.*)', '<homedir>\\node_modules\\next\\dist\\build\\jest\\__mocks__\\nextFontMock.js' ],
                [ 'next/font/(.*)', '<homedir>\\node_modules\\next\\dist\\build\\jest\\__mocks__\\nextFontMock.js' ],
                [ '\\.(scss|sass|css)$', 'identity-obj-proxy' ],
                [ '@/(.*)', [ 'src/common/$1', 'src/$1' ] ]
              ],
              modulePathIgnorePatterns: [],
              modulePaths: undefined,
              openHandlesTimeout: 1000,
              prettierPath: 'prettier',
              resetMocks: false,
              resetModules: false,
              resolver: undefined,
              restoreMocks: false,
              rootDir: '<homedir>',
              roots: [ '<homedir>' ],
              runner: '<homedir>\\node_modules\\jest-runner\\build\\index.js',
              runtime: undefined,
              sandboxInjectedGlobals: [],
              setupFiles: [],
              setupFilesAfterEnv: [ '<homedir>\\jest.setup.ts' ],
              skipFilter: false,
              skipNodeResolution: undefined,
              slowTestThreshold: 5,
              snapshotFormat: { escapeString: false, printBasicPrototype: false },
              snapshotResolver: undefined,
              snapshotSerializers: [],
              testEnvironment: '<homedir>\\node_modules\\jest-environment-jsdom\\build\\index.js',
              testEnvironmentOptions: {},
              testLocationInResults: false,
              testMatch: [ '**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)' ],
              testPathIgnorePatterns: [ '\\\\node_modules\\\\', '\\\\.next\\\\', '.\\\\.next\\\\', '.\\\\node_modules\\\\' ],
              testRegex: [],
              testRunner: '<homedir>\\node_modules\\jest-circus\\runner.js',
              transform: [
                [
                  '^.+\\.(js|jsx|ts|tsx|mjs)$',
                  '<homedir>\\node_modules\\next\\dist\\build\\swc\\jest-transformer.js',
                  {
                    modularizeImports: {
                      '@mui/icons-material': { transform: '@mui/icons-material/{{member}}' },
                      'date-fns': { transform: 'date-fns/{{member}}' },
                      lodash: { transform: 'lodash/{{member}}' },
                      'lodash-es': { transform: 'lodash-es/{{member}}' },
                      ramda: { transform: 'ramda/es/{{member}}' },
                      'react-bootstrap': {
                        transform: { useAccordionButton: 'modularize-import-loader?name=useAccordionButton&from=named&as=default!react-bootstrap/AccordionButton', '*': 'react-bootstrap/{{member}}' }
                      },
                      antd: { transform: 'antd/lib/{{kebabCase member}}' },
                      ahooks: { transform: { createUpdateEffect: 'modularize-import-loader?name=createUpdateEffect&from=named&as=default!ahooks/es/createUpdateEffect', '*': 'ahooks/es/{{member}}' } },
                      '@ant-design/icons': {
                        transform: {
                          IconProvider: 'modularize-import-loader?name=IconProvider&from=named&as=default!@ant-design/icons',
                          createFromIconfontCN: '@ant-design/icons/es/components/IconFont',
                          getTwoToneColor: 'modularize-import-loader?name=getTwoToneColor&from=named&as=default!@ant-design/icons/es/components/twoTonePrimaryColor',
                          setTwoToneColor: 'modularize-import-loader?name=setTwoToneColor&from=named&as=default!@ant-design/icons/es/components/twoTonePrimaryColor',
                          '*': '@ant-design/icons/lib/icons/{{member}}'
                        }
                      },
                      'next/server': { transform: 'next/dist/server/web/exports/{{ kebabCase member }}' }
                    },
                    swcPlugins: undefined,
                    compilerOptions: undefined,
                    jsConfig: {
                      compilerOptions: {
                        target: 99,
                        module: 99,
                        jsx: 1,
                        lib: [ 'lib.dom.d.ts', 'lib.es2017.d.ts' ],
                        moduleResolution: 2,
                        allowJs: true,
                        noEmit: true,
                        strict: true,
                        allowSyntheticDefaultImports: true,
                        skipLibCheck: true,
                        noUnusedLocals: true,
                        noUnusedParameters: true,
                        removeComments: false,
                        preserveConstEnums: true,
                        sourceMap: true,
                        forceConsistentCasingInFileNames: true,
                        esModuleInterop: true,
                        resolveJsonModule: true,
                        isolatedModules: true,
                        noImplicitAny: true,
                        baseUrl: 'C:/bayeq/repos/bayeq-git/BayEq.Cloud/BayEq.Cloud.Web',
                        paths: { '@/*': [ 'src/common/*', 'src/*' ] },
                        incremental: true,
                        plugins: [ { name: 'next' } ],
                        pathsBasePath: 'C:/bayeq/repos/bayeq-git/BayEq.Cloud/BayEq.Cloud.Web',
                        configFilePath: undefined
                      }
                    },
                    resolvedBaseUrl: '<homedir>',
                    hasServerComponents: false,
                    isEsmProject: false,
                    pagesDir: '<homedir>\\pages'
                  }
                ]
              ],
              transformIgnorePatterns: [ '\\\\node_modules\\\\', '^.+\\.module\\.(css|sass|scss)$' ],
              unmockedModulePathPatterns: undefined,
              watchPathIgnorePatterns: [ '\\\\.next\\\\' ]
            }
          ],
          globalConfig: {
            bail: 0,
            changedFilesWithAncestor: false,
            changedSince: undefined,
            ci: false,
            collectCoverage: false,
            collectCoverageFrom: [],
            coverageDirectory: '<homedir>\\coverage',
            coverageProvider: 'babel',
            coverageReporters: [ 'json', 'text', 'lcov', 'clover' ],
            coverageThreshold: undefined,
            detectLeaks: false,
            detectOpenHandles: false,
            errorOnDeprecated: false,
            expand: false,
            filter: undefined,
            findRelatedTests: false,
            forceExit: false,
            globalSetup: undefined,
            globalTeardown: undefined,
            json: false,
            lastCommit: false,
            listTests: false,
            logHeapUsage: false,
            maxConcurrency: 5,
            maxWorkers: 7,
            noSCM: undefined,
            noStackTrace: false,
            nonFlagArgs: undefined,
            notify: false,
            notifyMode: 'failure-change',
            onlyChanged: false,
            onlyFailures: false,
            openHandlesTimeout: 1000,
            outputFile: undefined,
            passWithNoTests: false,
            projects: [],
            randomize: undefined,
            replname: undefined,
            reporters: undefined,
            rootDir: '<homedir>',
            runTestsByPath: false,
            seed: -1772374386,
            shard: undefined,
            showSeed: undefined,
            silent: undefined,
            skipFilter: false,
            snapshotFormat: { escapeString: false, printBasicPrototype: false },
            testFailureExitCode: 1,
            testNamePattern: undefined,
            testPathPattern: '',
            testResultsProcessor: undefined,
            testSequencer: '<homedir>\\node_modules\\@jest\\test-sequencer\\build\\index.js',
            testTimeout: 8000,
            updateSnapshot: 'new',
            useStderr: false,
            verbose: undefined,
            watch: false,
            watchAll: false,
            watchPlugins: undefined,
            watchman: true,
            workerIdleMemoryLimit: undefined,
            workerThreads: false
          },
          hasDeprecationWarnings: false,
          wallaby: {
            roots: [],
            watchPathIgnorePatterns: [
              '\\\\node_modules\\\\',
              '\\.\\\\dist\\\\|\\.\\\\build\\\\|\\.\\\\coverage\\\\|\\.\\\\git\\\\|\\\\\\..+\\\\',
              'z:\\temp\\jest',
              '\\\\.next\\\\',
              '.\\\\.next\\\\',
              '.\\\\node_modules\\\\',
              '\\.\\coverage'
            ],
            testPathIgnorePatterns: [
              '\\\\node_modules\\\\',
              '\\.\\\\dist\\\\|\\.\\\\build\\\\|\\.\\\\coverage\\\\|\\.\\\\git\\\\|\\\\\\..+\\\\',
              'z:\\temp\\jest',
              '\\\\.next\\\\',
              '.\\\\.next\\\\',
              '.\\\\node_modules\\\\',
              '\\.\\coverage'
            ],
            testMatch: [ '**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)' ],
            testRegex: []
          }
        }
      }
    },
    testFramework: { version: 'jest@24.8.0', configurator: 'jest@24.8.0', reporter: 'jest@24.8.0', starter: 'jest@24.8.0', autoDetected: true },
    filesWithCoverageCalculated: [],
    filesWithNoCoverageCalculated: [],
    globalSetup: false,
    dot: true,
    files: [
      { pattern: '\\\\node_modules\\\\', regexp: /\\node_modules\\/, ignore: true, trigger: true, load: true, file: true, test: true },
      {
        pattern: '\\.\\\\dist\\\\|\\.\\\\build\\\\|\\.\\\\coverage\\\\|\\.\\\\git\\\\|\\\\\\..+\\\\',
        regexp: /\.\\dist\\|\.\\build\\|\.\\coverage\\|\.\\git\\|\\\..+\\/,
        ignore: true,
        trigger: true,
        load: true,
        file: true,
        test: true
      },
      { pattern: 'z:\\temp\\jest', regexp: /z:\temp\jest/, ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '\\\\.next\\\\', regexp: /\\.next\\/, ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '.\\\\.next\\\\', regexp: /.\\.next\\/, ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '.\\\\node_modules\\\\', regexp: /.\\node_modules\\/, ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '\\.\\coverage', regexp: /\.\coverage/, ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/**', ignore: false, trigger: true, load: true, order: 1 },
      { pattern: '**/__tests__/**/*.[jt]s?(x)', ignore: true, trigger: true, load: true, file: true },
      { pattern: '**/?(*.)+(spec|test).[tj]s?(x)', ignore: true, trigger: true, load: true, file: true }
    ],
    captureConsoleLog: true,
    tests: [
      { pattern: '\\\\node_modules\\\\', regexp: /\\node_modules\\/, ignore: true, trigger: true, load: true, test: true, file: false },
      {
        pattern: '\\.\\\\dist\\\\|\\.\\\\build\\\\|\\.\\\\coverage\\\\|\\.\\\\git\\\\|\\\\\\..+\\\\',
        regexp: /\.\\dist\\|\.\\build\\|\.\\coverage\\|\.\\git\\|\\\..+\\/,
        ignore: true,
        trigger: true,
        load: true,
        test: true,
        file: false
      },
      { pattern: 'z:\\temp\\jest', regexp: /z:\temp\jest/, ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '\\\\.next\\\\', regexp: /\\.next\\/, ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '.\\\\.next\\\\', regexp: /.\\.next\\/, ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '.\\\\node_modules\\\\', regexp: /.\\node_modules\\/, ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '\\.\\coverage', regexp: /\.\coverage/, ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/__tests__/**/*.[jt]s?(x)', ignore: false, trigger: true, load: true, test: true, order: 2 },
      { pattern: '**/?(*.)+(spec|test).[tj]s?(x)', ignore: false, trigger: true, load: true, test: true, order: 3 }
    ],
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    compilers: {},
    smartStart: [ { test: true, source: false, pattern: '**/*', startMode: 'open' }, { test: false, source: true, pattern: '**/*', startMode: 'edit' } ],
    logLimits: { inline: { depth: 5, elements: 5000 }, values: { default: { stringLength: 200 }, autoExpand: { elements: 5000, stringLength: 8192, depth: 10 } } },
    preprocessors: {},
    maxConsoleMessagesPerTest: 100,
    autoConsoleLog: true,
    delays: { run: 0, edit: 100, update: 0 },
    workers: { initial: 0, regular: 0, recycle: false },
    teardown: undefined,
    hints: {
      ignoreCoverage: '__REGEXP /ignore coverage|istanbul ignore|c8 ignore/',
      ignoreCoverageForFile: '__REGEXP /ignore file coverage/',
      commentAutoLog: '?',
      testFileSelection: { include: '__REGEXP /file\\.only/', exclude: '__REGEXP /file\\.skip/' }
    },
    automaticTestFileSelection: true,
    runSelectedTestsOnly: true,
    mapConsoleMessagesStackTrace: false,
    extensions: {},
    env: { type: 'node', params: {}, runner: 'C:\\Program Files\\nodejs\\node.exe', viewportSize: { width: 800, height: 600 }, options: { width: 800, height: 600 }, bundle: true },
    reportUnhandledPromises: true,
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    runAllTestsWhenNoAffectedTests: false,
    configCode: 'auto.detect#-133008878',
    testLocations: [ 'src/test/components/Worf.test.tsx' ]
  },
  packageJSON: {
    dependencies: {
      '@azure/msal-browser': '^2.37.0',
      '@azure/msal-react': '1.5.12',
      '@chakra-ui/next-js': '^2.1.4',
      '@chakra-ui/react': '2',
      '@codemirror/lang-markdown': '^6.1.1',
      '@emotion/styled': '^11.11.0',
      '@hello-pangea/dnd': '^16.5.0',
      '@microsoft/microsoft-graph-client': '3.0.7',
      '@tinymce/tinymce-react': '4.3.2',
      '@uiw/codemirror-themes': '^4.19.16',
      '@uiw/react-codemirror': '^4.19.16',
      'chakra-ui-markdown-renderer': '^4.0.0',
      'date-fns': '^2.23.0',
      'dom-to-image': '^2.6.0',
      'file-saver': '^2.0.5',
      filesize: '^10.0.7',
      'font-awesome': '^4.7.0',
      formik: '^2.2.9',
      'framer-motion': '^10.12.9',
      'hamburger-react': '^2.5.0',
      immer: '10.0.3',
      json5: '^2.2.1',
      lodash: '^4.17.21',
      'match-sorter': '^6.3.0',
      next: '^13.4.4',
      numeral: '^2.0.6',
      odometer: '^0.4.8',
      'query-string': '^7.0.0',
      react: '^18.2.0',
      'react-accessible-accordion': '^5.0.0',
      'react-avatar-editor': '^13.0.0',
      'react-colorful': '^5.5.1',
      'react-datepicker': '^4.24.0',
      'react-dom': '^18.2.0',
      'react-dropzone': '^14.2.3',
      'react-focus-on': '^3.8.1',
      'react-ga4': '^2.1.0',
      'react-google-charts': '4.0.1',
      'react-icons': '^4.12.0',
      'react-infinite-scroll-component': '^6.1.0',
      'react-json-view': '^1.21.3',
      'react-markdown': '^8.0.7',
      'react-number-format': '^5.3.1',
      'react-odometerjs': '^2.1.1',
      'react-pose': '^4.0.10',
      'react-redux': '8',
      'react-select': '^5.8.0',
      'react-table': '7',
      'react-toastify': '^9.1.3',
      'react-tooltip': '^5.25.0',
      recharts: '^2.10.3',
      redux: '^4.0.5',
      'redux-devtools-extension': '^2.13.9',
      'remark-gfm': '^3.0.0',
      reselect: '^4.0.0',
      shortid: '^2.2.16',
      'stable-hash': '^0.0.3',
      store: '^2.0.12',
      superagent: '^6.1.0',
      tinymce: '5.10.9',
      'typesafe-actions': '^5.1.0',
      'use-debounce': '10.0.0',
      'use-interval': '^1.3.0'
    },
    devDependencies: {
      '@next/bundle-analyzer': '^14.0.3',
      '@reduxjs/toolkit': '^1.9.7',
      '@testing-library/dom': '^9.2.0',
      '@testing-library/jest-dom': '^5.16.5',
      '@testing-library/react': '^14.0.0',
      '@testing-library/user-event': '^14.4.3',
      '@types/dom-to-image': '^2.6.7',
      '@types/file-saver': '^2.0.7',
      '@types/filesize': '^5.0.0',
      '@types/jest': '^29.5.10',
      '@types/lodash': '^4.14.202',
      '@types/match-sorter': '6.0.0',
      '@types/microsoft-graph': '^2.40.0',
      '@types/node': '^17.0.45',
      '@types/numeral': '^2.0.5',
      '@types/react': '18.2.5',
      '@types/react-avatar-editor': '^13.0.2',
      '@types/react-codemirror': '^1.0.11',
      '@types/react-datepicker': '^4.19.3',
      '@types/react-dom': '18.2.0',
      '@types/react-table': '^7.7.18',
      '@types/recharts': '^2.0.0',
      '@types/shortid': '^0.0.29',
      '@types/store': '^2.0.5',
      '@types/superagent': '^4.1.24',
      'cp-cli': '^2.0.0',
      'cpy-cli': '^3.1.1',
      'cross-env': '^7.0.3',
      eslint: '^8.54.0',
      'eslint-config-next': '^14.0.3',
      'eslint-config-prettier': '^9.0.0',
      'eslint-plugin-functional': '^4.1.1',
      'eslint-plugin-prettier': '^4.2.1',
      'identity-obj-proxy': '^3.0.0',
      jest: '^29.5.0',
      'jest-environment-jsdom': '^29.5.0',
      'next-unused': '^0.0.6',
      'npm-run-all': '^4.1.5',
      prettier: '^2.2.1',
      'redux-mock-store': '^1.5.4',
      renamer: '^4.0.0',
      rimraf: '5.0.5',
      typescript: '^5.3.2'
    }
  },
  fs: { numberOfFiles: 695 },
  debug: [
    '2024-02-13T18:52:37.966Z project waiting for initial run signal\n',
    '2024-02-13T18:52:37.978Z config Attempting automatic configuration for angular\n',
    '2024-02-13T18:52:37.982Z angular/cli config Angular CLI not found.\n',
    '2024-02-13T18:52:37.982Z config Finished attempting automatic configuration for angular (4ms)\n',
    '2024-02-13T18:52:37.983Z config Attempting automatic configuration for jest\n',
    '2024-02-13T18:52:38.796Z jest/config Detected Jest.\n',
    '2024-02-13T18:52:38.797Z jest/config Configured Jest.\n',
    '2024-02-13T18:52:38.798Z config Finished attempting automatic configuration for jest (815ms)\n',
    '2024-02-13T18:52:38.800Z project Wallaby Node version: v18.19.0\n',
    '2024-02-13T18:52:38.800Z project Wallaby config: <homedir>\\auto.detect\n',
    '2024-02-13T18:52:38.881Z fs File system starting\n',
    '2024-02-13T18:52:40.575Z fs File system scan completed\n',
    '2024-02-13T18:52:40.598Z project File cache: <userdir>\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.371\\projects\\ee85c729f68de1ae\n',
    '2024-02-13T18:52:41.153Z uiService Listening port 51235\n',
    '2024-02-13T18:52:41.171Z project package.json file change detected, invalidating local cache\n',
    '2024-02-13T18:52:41.225Z workers Parallelism for initial run: 6, for regular run: 3\n',
    '2024-02-13T18:52:41.226Z workers Starting run worker instance #0\n',
    '2024-02-13T18:52:41.226Z workers Starting run worker instance #1\n',
    '2024-02-13T18:52:41.226Z workers Starting run worker instance #2\n',
    '2024-02-13T18:52:41.226Z workers Starting run worker instance #3\n',
    '2024-02-13T18:52:41.226Z workers Starting run worker instance #4\n',
    '2024-02-13T18:52:41.226Z workers Starting run worker instance #5\n',
    '2024-02-13T18:52:41.229Z workers Web server is listening at 64657\n',
    '2024-02-13T18:52:41.230Z project File cache requires some updates, waiting required files from IDE\n',
    '2024-02-13T18:52:41.688Z project Stopping process pool\n',
    '2024-02-13T18:52:41.706Z project Test run started; run priority: 3\n',
    '2024-02-13T18:52:41.716Z project Running all tests\n',
    '2024-02-13T18:52:41.758Z project Test run finished\n',
    '2024-02-13T18:52:41.759Z project Test run data re-queued\n',
    '2024-02-13T18:52:43.003Z workers Started run worker instance (delayed) #1\n',
    '2024-02-13T18:52:43.025Z workers Started run worker instance (delayed) #3\n',
    '2024-02-13T18:52:43.095Z workers Started run worker instance (delayed) #0\n',
    '2024-02-13T18:52:43.236Z workers Started run worker instance (delayed) #2\n',
    '2024-02-13T18:52:43.322Z workers Started run worker instance (delayed) #4\n',
    '2024-02-13T18:52:43.475Z workers Started run worker instance (delayed) #5\n',
    '2024-02-13T18:53:46.877Z project Requested to run all tests\n',
    '2024-02-13T18:53:46.905Z project Test run started; run priority: 3\n',
    '2024-02-13T18:53:46.905Z project Running all tests\n',
    '2024-02-13T18:53:46.915Z workers Starting test run, priority: 3\n',
    '2024-02-13T18:53:46.915Z nodeRunner Starting sandbox [worker #0, session #ft80e]\n',
    '2024-02-13T18:53:46.915Z nodeRunner Preparing sandbox [worker #0, session #ft80e]\n',
    '2024-02-13T18:53:46.915Z nodeRunner Prepared sandbox [worker #0, session #ft80e]\n',
    '2024-02-13T18:53:46.915Z workers [worker #0, session #ft80e] Running tests in sandbox\n',
    "2024-02-13T18:53:47.946Z workers 'Scheduling Jest Test Run (ft80e): 2024-02-13T18:53:47.944Z'\n",
    '2024-02-13T18:53:49.720Z workers Sandbox (active) [ft80e] error: invalid type: map, expected a string at line 1 column 1185\n' +
      '    at Object.transformSync (.\\node_modules\\next\\src\\build\\swc\\index.ts:437:25)\n' +
      '    at transformSync (.\\node_modules\\next\\src\\build\\swc\\index.ts:615:19)\n' +
      '    at Object.process (.\\node_modules\\next\\src\\build\\swc\\jest-transformer.ts:102:25)\n' +
      '    at ScriptTransformer.transformSource (.\\node_modules\\@jest\\transform\\build\\ScriptTransformer.js:542:31)\n' +
      '    at ScriptTransformer._transformAndBuildScript (.\\node_modules\\@jest\\transform\\build\\ScriptTransformer.js:671:40)\n' +
      '    at ScriptTransformer.transform (.\\node_modules\\@jest\\transform\\build\\ScriptTransformer.js:723:19)\n' +
      '    at Runtime.transformFile (.\\node_modules\\jest-runtime\\build\\index.js:1455:53)\n' +
      '    at Runtime._execModule (.\\node_modules\\jest-runtime\\build\\index.js:1387:34)\n' +
      '    at Runtime._loadModule (.\\node_modules\\jest-runtime\\build\\index.js:1013:12)\n' +
      '    at Runtime.requireModule (.\\node_modules\\jest-runtime\\build\\index.js:873:12)\n' +
      '    at jestAdapter (.\\node_modules\\jest-circus\\build\\legacy-code-todo-rewrite\\jestAdapter.js:70:15)\n' +
      '    at runTestInternal (.\\node_modules\\jest-runner\\build\\runTest.js:367:16)\n' +
      '    at runTest (.\\node_modules\\jest-runner\\build\\runTest.js:444:34)\n',
    '2024-02-13T18:53:49.722Z workers [ft80e] Run 0 test(s), skipped 0 test(s)\n',
    "2024-02-13T18:53:49.725Z workers 'Jest Test Run Complete (ft80e): 2024-02-13T18:53:49.724Z'\n",
    '2024-02-13T18:53:49.728Z workers [ft80e] Sandbox is responsive, closing it\n',
    '2024-02-13T18:53:49.729Z workers Failed to map the stack to user code, entry message: invalid type: map, expected a string at line 1 column 1185, stack: Error: invalid type: map, expected a string at line 1 column 1185\n' +
      '    at Object.transformSync (<homedir>\\node_modules\\next\\src\\build\\swc\\index.ts:437:25)\n' +
      '    at transformSync (<homedir>\\node_modules\\next\\src\\build\\swc\\index.ts:615:19)\n' +
      '    at Object.process (<homedir>\\node_modules\\next\\src\\build\\swc\\jest-transformer.ts:102:25)\n' +
      '    at Object.l.process (<userdir>\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.371\\wallaby87ecc5\\runners\\node\\jest@24.8.0\\initializer.js:36:16977)\n' +
      '    at ScriptTransformer.transformSource (<homedir>\\node_modules\\@jest\\transform\\build\\ScriptTransformer.js:542:31)\n' +
      '    at ScriptTransformer._transformAndBuildScript (<homedir>\\node_modules\\@jest\\transform\\build\\ScriptTransformer.js:671:40)\n' +
      '    at ScriptTransformer.transform (C:\\bayeq\\repos\\bayeq-git\\BayEq.Cloud\\BayEq.Cloud\n',
    '2024-02-13T18:53:49.730Z project Test run finished\n',
    '2024-02-13T18:53:49.730Z project Processed console.log entries\n',
    '2024-02-13T18:53:49.730Z project Processed loading sequences\n',
    '2024-02-13T18:53:49.730Z project Processed executed tests\n',
    '2024-02-13T18:53:49.731Z project Processed code coverage\n',
    '2024-02-13T18:53:49.736Z project Test run result processed and sent to IDE\n',
    '2024-02-13T18:54:02.798Z uiService UI client connected\n',
    '2024-02-13T18:54:02.800Z uiService Outgoing message ui:handshake\n',
    '2024-02-13T18:54:02.839Z uiService Incoming message ui:start\n',
    '2024-02-13T18:54:02.843Z uiService Outgoing message ui:summary\n',
    '2024-02-13T18:54:02.856Z uiService Outgoing message ui:files\n',
    '2024-02-13T18:54:02.859Z uiService Incoming message ui:tests:resultsRequested\n',
    '2024-02-13T18:54:02.866Z uiService Outgoing message ui:tests:allResultsUpdated\n'
  ]
}
smcenlly commented 7 months ago

It sounds like your dependencies vs. your coworker's dependencies are different, and this might be the cause of your problem.

Out of interest, does the CLI work for you if you try and run your tests outside of Wallaby? I would have expected you would have the same problem, but it's possible it's specific to Wallaby.

Can you please try cloning your repo to a fresh directory, reinstalling your node modules, and then restarting Wallaby?

If that doesn't work for you, can you please try the same thing on your coworker's machine to see if it then breaks in the same way?

Finally, that that doesn't work, can you do a file diff for your project / dependencies vs. your coworker? This should allow you to understand why you're getting different test results.

kyeckeq commented 7 months ago

Hi and thank you for the quick reply. After going through your recommendations, here's the results...

  1. Does the CLI work for you if you try and run your tests outside of Wallaby? Yes, I can run Jest just fine; all the tests are passing.
  2. Please try cloning your repo to a fresh directory, reinstalling your node modules, and then restarting Wallaby? I tried that, didn't help.
  3. Please try the same thing on your coworker's machine to see if it then breaks in the same way? My coworker isn't willing to re-clone is project.
  4. Finally, that that doesn't work, can you do a file diff for your project / dependencies vs. your coworker? I was able to get a zipped copy of my coworkers project folder and ran a diff on it, but didn't find anything noteworthy. Also, I opened his folder in VS Code and Wallaby gave the same error. There must be something in my profile or environment outside of the project that's causing this, but what...
smcenlly commented 7 months ago

After a bit of digging on the internet, I found this issue with swc, which is where your stack trace is originating.

I would have expected to see the same error from the jest CLI. I'm guessing there may be some environment variable set when jest is running that is not set when Wallaby is running that changes in the behavior/options passed to swc. You may be able to try debugging this by modifying node_modules/next/dist/build/swc/index.js and adding some logging (e.g. console.log) before transformSync calls to see how the options parameter differs when you run with jest vs. wallaby. This may reveal what you're missing when Wallaby is running.

It seems that this problem was fixed in swc@1.3.106, so perhaps updating your dependencies will also fix the problem?

kyeckeq commented 7 months ago

I tried debugging and determined it comes down to the config parameter that's passed to jest-runner in runTest() (runTest.js). I was able to resolve the issue by setting modularizeImports = undefined (in config.transform). Unfortunately, I wasn't able to figure out where/how that property is being set differently from my coworker, but at least I've got a work-around now that allows Wallaby to startup without any errors.

re: swc -- We're running next v13.4.4. Bumping to v13.5 will allow us to move to optimizePackageImports which may resolve the issue but we're not able to do that at the moment.

If you have any other valuable insight, please feel free to pass along. For now, I'm comfortable closing this request/issue.

Thank you for all of your help!

smcenlly commented 7 months ago

Glad to hear that you got it working. We don't have any other suggestions at this point in time, but happy to revisit with you later if needed.