wallabyjs / public

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

[Error] Test run failure: Sandbox load failed, status: failed: Using unsafe HTTP verb GET to invoke /json/new. This action supports only PUT verb. #3186

Closed FreeBLD closed 1 year ago

FreeBLD commented 1 year ago

Issue description or question

Upon starting wallaby.js the engine throws the error bellow in the Wallaby.js Tests output window. ‌[Error] Test run failure: Sandbox load failed, status: failed: Using unsafe HTTP verb GET to invoke /json/new. This action supports only PUT verb.

I tried googling this problem and found something similar relatated to wallaby.js here https://github.com/wallabyjs/public/issues/2881. I had my environment variable CHROME_BIN set to edge so I replaced it with the chrome one, but it did not solve the issue.

I tried also to clear the wallaby cache as well as removing the extension and deleting the files associated with the extension and re-installing it but with no luck.

There were other projects that stumbled across this issue, related to chromium enforcing more stringent rules against XSS. Like in this one here https://github.com/GoogleChrome/lighthouse/pull/14063

Thanks for your support, Cristian

Wallaby diagnostics report

{
  editorVersion: '1.76.2',
  pluginVersion: '1.0.351',
  editorType: 'VSCode',
  osVersion: 'win32 10.0.19045',
  nodeVersion: 'v18.15.0',
  coreVersion: '1.0.1257',
  checksum: 'MGM0ODc3MjBkMDY0OGE3MGNjMzRmNzhkZDBlNTY3YWIsMTY1MDY3MjAwMDAwMCww',
  config: {
    diagnostics: {
      angular: {
        workspace: {
          '$schema': './node_modules/@angular/cli/lib/config/schema.json',
          version: 1,
          newProjectRoot: 'projects',
          projects: {
            app: {
              root: '',
              sourceRoot: 'src',
              projectType: 'application',
              architect: {
                build: {
                  builder: '@angular-devkit/build-angular:browser',
                  options: {
                    outputPath: 'wwwroot',
                    index: 'src/index.html',
                    main: 'src/main.ts',
                    tsConfig: 'src/tsconfig.app.json',
                    polyfills: 'src/polyfills.ts',
                    assets: [
                      'src/assets',
                      'src/favicon.ico',
                      'src/assets/icons/green/favicon.ico',
                      'src/fonts',
                      'src/manifest.webmanifest',
                      'src/manifest-green-theme.webmanifest',
                      'src/manifest-orange-theme.webmanifest',
                      'src/manifest-red-theme.webmanifest',
                      'src/redirect.html'
                    ],
                    styles: [ 'src/styles.scss' ],
                    scripts: [ 'src/themes/theme-selector.js' ],
                    vendorChunk: true,
                    extractLicenses: false,
                    buildOptimizer: false,
                    sourceMap: true,
                    optimization: false,
                    namedChunks: true
                  },
                  configurations: {
                    production: {
                      budgets: [ { type: 'anyComponentStyle', maximumWarning: '6kb' } ],
                      optimization: true,
                      outputHashing: 'all',
                      sourceMap: false,
                      namedChunks: false,
                      extractLicenses: true,
                      vendorChunk: false,
                      buildOptimizer: true,
                      serviceWorker: true,
                      ngswConfigPath: 'ngsw-config.json',
                      fileReplacements: [ { replace: 'src/environments/environment.ts', with: 'src/environments/environment.prod.ts' } ]
                    }
                  },
                  defaultConfiguration: ''
                },
                serve: {
                  builder: '@angular-devkit/build-angular:dev-server',
                  options: { browserTarget: 'app:build' },
                  configurations: {
                    production: { browserTarget: 'app:build:production' }
                  }
                },
                'extract-i18n': { builder: '@angular-devkit/build-angular:extract-i18n', options: { browserTarget: 'app:build' } },
                test: {
                  builder: '@angular-devkit/build-angular:karma',
                  options: {
                    main: 'src/test.ts',
                    karmaConfig: './karma.conf.js',
                    polyfills: 'src/polyfills.ts',
                    tsConfig: 'src/tsconfig.spec.json',
                    scripts: [ 'src/themes/theme-selector.js' ],
                    styles: [ 'src/styles.scss' ],
                    assets: [
                      'src/assets',
                      'src/favicon.ico',
                      'src/assets/icons/green/favicon.ico',
                      'src/fonts',
                      'src/manifest.webmanifest',
                      'src/manifest-green-theme.webmanifest',
                      'src/manifest-orange-theme.webmanifest',
                      'src/manifest-red-theme.webmanifest'
                    ]
                  }
                }
              }
            },
            'e2e': {
              root: 'e2e',
              sourceRoot: 'e2e',
              projectType: 'application',
              architect: { e2e: { builder: '@angular-devkit/build-angular:protractor', options: { protractorConfig: './protractor.conf.js', devServerTarget: 'pdb2:serve' } } }
            }
          },
          schematics: { '@schematics/angular:component': { prefix: 'app', style: 'scss' }, '@schematics/angular:directive': { prefix: 'app' } },
          cli: { analytics: false, cache: { enabled: true, path: '.cache', environment: 'all' } }
        },
        main: '// This file is required by karma.conf.js and loads recursively all the .spec and framework files\r\n' +
          '\r\n' +
          "import 'zone.js/testing';\r\n" +
          "import { getTestBed } from '@angular/core/testing';\r\n" +
          'import {\r\n' +
          '  BrowserDynamicTestingModule,\r\n' +
          '  platformBrowserDynamicTesting\r\n' +
          "} from '@angular/platform-browser-dynamic/testing';\r\n" +
          '\r\n' +
          'declare const require: {\r\n' +
          '  context(path: string, deep?: boolean, filter?: RegExp): {\r\n' +
          '    keys(): string[];\r\n' +
          '    <T>(id: string): T;\r\n' +
          '  };\r\n' +
          '};\r\n' +
          '\r\n' +
          '// First, initialize the Angular testing environment.\r\n' +
          'getTestBed().initTestEnvironment(\r\n' +
          '  BrowserDynamicTestingModule,\r\n' +
          '  platformBrowserDynamicTesting(), {\r\n' +
          '    teardown: { destroyAfterEach: false }\r\n' +
          '}\r\n' +
          ');\r\n' +
          '// Then we find all the tests.\r\n' +
          '\r\n' +
          '// And load the modules.\r\n' +
          '\r\n'
      }
    },
    testFramework: { version: 'jasmine@3.10.0', configurator: 'jasmine@2.1.3', reporter: 'jasmine@2.1.3', starter: 'jasmine@2.1.3', autoDetected: true },
    env: { kind: 'chrome', type: 'browser', params: {}, viewportSize: { width: 800, height: 600 }, options: { width: 800, height: 600 }, bundle: true },
    files: [
      { pattern: 'src/**/*.spec.ts', ignore: true, trigger: true, load: true },
      { pattern: 'src/polyfills.ts', ignore: true, trigger: true, load: true },
      { pattern: 'src/test.ts', ignore: true, trigger: true, load: true },
      { pattern: 'src/main.ts', ignore: true, trigger: true, load: true },
      { pattern: 'src/index.html', ignore: true, trigger: true, load: true },
      { pattern: 'src/test.base.ts', ignore: true, trigger: true, load: true },
      { pattern: 'src/test.wallaby.ts', ignore: false, trigger: true, load: true, order: 1 },
      { pattern: 'src/themes/theme-selector.js', instrument: false, load: true, ignore: false, trigger: true, order: 2 },
      { pattern: 'src/**/*.+(ts|js)', load: false, ignore: false, trigger: true, order: 3 },
      { pattern: 'src/**/*.+(css|less|scss|sass|styl|html|json|svg)', instrument: false, load: false, ignore: false, trigger: true, order: 4 }
    ],
    tests: [ { pattern: 'src/**/*.spec.ts', load: false, ignore: false, trigger: true, test: true, order: 5 } ],
    filesWithNoCoverageCalculated: [],
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    compilers: {},
    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/',
      ignoreCoverageForFile: '__REGEXP /ignore file coverage/',
      commentAutoLog: '?',
      testFileSelection: { include: '__REGEXP /file\\.only/', exclude: '__REGEXP /file\\.skip/' }
    },
    automaticTestFileSelection: true,
    runSelectedTestsOnly: false,
    mapConsoleMessagesStackTrace: false,
    extensions: {},
    reportUnhandledPromises: false,
    throwOnBeforeUnload: true,
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    loose: true,
    configCode: 'auto.detect#-127931979'
  },
  packageJSON: {
    dependencies: {
      '@angular/animations': '~14.2.0',
      '@angular/cdk': '~14.2.0',
      '@angular/common': '~14.2.0',
      '@angular/compiler': '~14.2.0',
      '@angular/core': '~14.2.0',
      '@angular/flex-layout': '~14.0.0-beta.41',
      '@angular/forms': '~14.2.0',
      '@angular/localize': '~14.2.0',
      '@angular/material': '~14.2.0',
      '@angular/material-moment-adapter': '~14.2.0',
      '@angular/platform-browser': '~14.2.0',
      '@angular/platform-browser-dynamic': '~14.2.0',
      '@angular/router': '~14.2.0',
      '@angular/service-worker': '~14.2.0',
      '@azure/msal-angular': '^2.0.4',
      '@azure/msal-browser': '^2.18.0',
      '@improbable-eng/grpc-web': '^0.15.0',
      'angular-notifier': '^12.0.0',
      'core-js': '^3.1.3',
      d3: '^7.1.0',
      dexie: '^3.2.2',
      'download-cli': '^1.0.1',
      'linq-collections': '^1.0.254',
      luxon: '^3.1.0',
      moment: '^2.29.3',
      'ngx-infinite-scroll': '^8.0.0',
      'ngx-vis': '^3.1.1',
      npm: '^9.1.2',
      qrcode: '^1.5.0',
      rxjs: '^7.5.6',
      testcafe: '^1.2.0',
      'testcafe-angular-selectors': '^0.3.2',
      tslib: '^2.0.0',
      'zone.js': '~0.11.4'
    },
    devDependencies: {
      '@angular-devkit/build-angular': '^14.2.9',
      '@angular/cli': '~14.2.1',
      '@angular/compiler-cli': '~14.2.0',
      '@compodoc/compodoc': '^1.1.18',
      '@egjs/hammerjs': '^2.0.17',
      '@types/d3': '^7.1.0',
      '@types/jasmine': '~3.6.0',
      '@types/luxon': '^3.0.2',
      '@types/node': '^12.11.1',
      'component-emitter': '^1.3.0',
      concat: '^1.0.3',
      'eol-converter-cli': '^1.0.8',
      express: '^4.17.1',
      'jasmine-core': '~4.3.0',
      'jasmine-spec-reporter': '~5.0.0',
      karma: '^6.3.17',
      'karma-chrome-launcher': '~3.1.0',
      'karma-coverage-istanbul-reporter': '~3.0.2',
      'karma-jasmine': '~4.0.0',
      'karma-jasmine-html-reporter': '^1.5.0',
      'karma-junit-reporter': '^1.2.0',
      'karma-phantomjs-launcher': '^1.0.4',
      'karma-verbose-reporter': '0.0.6',
      keycharm: '^0.4.0',
      'propagating-hammerjs': '^2.0.1',
      protractor: '~7.0.0',
      timsort: '^0.3.0',
      'ts-node': '^8.2.0',
      'ts-proto': '^1.100.1',
      tslint: '~6.1.0',
      typescript: '~4.7.4',
      'webpack-bundle-analyzer': '^4.7.0'
    }
  },
  fs: { numberOfFiles: 1735 },
  debug: [
    '2023-03-21T15:56:29.960Z angular/cli config Detected Angular CLI.\n',
    '2023-03-21T15:56:29.965Z angular/cli config Angular currentDirPath: "C:\\Users\\cpogo\\source\\repos\\pdb\\src\\app.pdb", workspaceDirPath: "C:\\Users\\cpogo\\source\\repos\\pdb\\src\\app.pdb"\n',
    '2023-03-21T15:56:35.586Z angular/cli karma project config Using virtual C:/Users/cpogo/source/repos/pdb/src/app.pdb/src/test.ts.\n',
    '2023-03-21T15:56:35.648Z project Wallaby Node version: v18.15.0\n',
    '2023-03-21T15:56:35.648Z project Wallaby config: C:\\Users\\cpogo\\source\\repos\\pdb\\src\\app.pdb\\auto.detect\n',
    '2023-03-21T15:56:40.089Z project File cache: C:\\Users\\cpogo\\.vscode\\extensions\\wallabyjs.wallaby-vscode-1.0.351\\projects\\24bd325643afb64f\n',
    '2023-03-21T15:56:40.560Z uiService Listening port 51235\n',
    '2023-03-21T15:56:40.592Z project package.json file change detected, invalidating local cache\n',
    '2023-03-21T15:56:40.780Z workers Parallelism for initial run: 6, for regular run: 3\n',
    '2023-03-21T15:56:40.780Z workers Starting run worker instance #0\n',
    '2023-03-21T15:56:40.780Z workers Starting run worker instance #1\n',
    '2023-03-21T15:56:40.781Z workers Starting run worker instance #2\n',
    '2023-03-21T15:56:40.781Z workers Starting run worker instance #3\n',
    '2023-03-21T15:56:40.781Z workers Starting run worker instance #4\n',
    '2023-03-21T15:56:40.781Z workers Starting run worker instance #5\n',
    '2023-03-21T15:56:40.789Z workers Web server is listening at 51136\n',
    '2023-03-21T15:56:40.816Z project Stopping process pool\n',
    '2023-03-21T15:56:40.816Z project File cache is up-to-date, starting full test run\n',
    '2023-03-21T15:56:40.820Z project Running postprocessor\n',
    '2023-03-21T15:56:40.845Z postprocessor Processing started.\n',
    '2023-03-21T15:56:40.846Z postprocessor Initializing.\n',
    '2023-03-21T15:56:40.849Z postprocessor Initializing entry.\n',
    '2023-03-21T15:56:40.850Z postprocessor Sanitizing configuration.\n',
    '2023-03-21T15:56:40.851Z postprocessor Adjusting configuration.\n',
    '2023-03-21T15:56:40.860Z postprocessor Creating compiler.\n',
    '2023-03-21T15:56:41.457Z postprocessor Customizing compiler.\n',
    '2023-03-21T15:56:41.457Z postprocessor Compilation started.\n',
    '2023-03-21T15:57:10.945Z workers Started run worker instance (immediate) #0\n',
    '2023-03-21T15:57:10.945Z workers Started run worker instance (immediate) #1\n',
    '2023-03-21T15:57:10.945Z workers Started run worker instance (immediate) #2\n',
    '2023-03-21T15:57:10.945Z workers Started run worker instance (immediate) #3\n',
    '2023-03-21T15:57:10.945Z workers Started run worker instance (immediate) #4\n',
    '2023-03-21T15:57:10.945Z workers Started run worker instance (immediate) #5\n',
    '2023-03-21T15:58:09.068Z postprocessor Compilation finished.\n',
    '2023-03-21T15:58:15.063Z postprocessor Emitting 2626 files.\n',
    '2023-03-21T15:58:15.362Z postprocessor Processing finished.\n',
    '2023-03-21T15:58:15.747Z project Postprocessor execution finished\n',
    '2023-03-21T15:58:15.748Z project Test run started; run priority: 3\n',
    '2023-03-21T15:58:15.794Z project Running all tests\n',
    '2023-03-21T15:58:15.957Z workers Starting test run, priority: 3\n',
    '2023-03-21T15:58:15.958Z workers Distributing tests between 6 workers\n',
    '2023-03-21T15:58:15.981Z workers Running tests in parallel\n',
    '2023-03-21T15:58:15.982Z chromeRunner Starting sandbox [worker #0, session #yw2ph]\n',
    '2023-03-21T15:58:15.983Z chromeRunner Starting sandbox [worker #1, session #pet9z]\n',
    '2023-03-21T15:58:15.983Z chromeRunner Starting sandbox [worker #2, session #jw0ss]\n',
    '2023-03-21T15:58:15.983Z chromeRunner Starting sandbox [worker #3, session #mtdnr]\n',
    '2023-03-21T15:58:15.983Z chromeRunner Starting sandbox [worker #4, session #5ei4x]\n',
    '2023-03-21T15:58:15.983Z chromeRunner Starting sandbox [worker #5, session #v1ck4]\n',
    '2023-03-21T15:58:15.984Z chromeRunner Preparing sandbox [worker #0, session #yw2ph]\n',
    '2023-03-21T15:58:15.993Z browserRunner Total files to load in sandbox: 55\n',
    '2023-03-21T15:58:16.006Z browserRunner Sandbox is generated [worker #0, session #yw2ph]: http://localhost:51136/wallaby_sandbox0.html\n',
    '2023-03-21T15:58:16.006Z chromeRunner Preparing sandbox [worker #1, session #pet9z]\n',
    '2023-03-21T15:58:16.013Z browserRunner Total files to load in sandbox: 56\n',
    '2023-03-21T15:58:16.026Z browserRunner Sandbox is generated [worker #1, session #pet9z]: http://localhost:51136/wallaby_sandbox1.html\n',
    '2023-03-21T15:58:16.026Z chromeRunner Preparing sandbox [worker #2, session #jw0ss]\n',
    '2023-03-21T15:58:16.033Z browserRunner Total files to load in sandbox: 56\n',
    '2023-03-21T15:58:16.046Z browserRunner Sandbox is generated [worker #2, session #jw0ss]: http://localhost:51136/wallaby_sandbox2.html\n',
    '2023-03-21T15:58:16.046Z chromeRunner Preparing sandbox [worker #3, session #mtdnr]\n',
    '2023-03-21T15:58:16.054Z browserRunner Total files to load in sandbox: 56\n',
    '2023-03-21T15:58:16.072Z browserRunner Sandbox is generated [worker #3, session #mtdnr]: http://localhost:51136/wallaby_sandbox3.html\n',
    '2023-03-21T15:58:16.072Z chromeRunner Preparing sandbox [worker #4, session #5ei4x]\n',
    '2023-03-21T15:58:16.080Z browserRunner Total files to load in sandbox: 55\n',
    '2023-03-21T15:58:16.094Z browserRunner Sandbox is generated [worker #4, session #5ei4x]: http://localhost:51136/wallaby_sandbox4.html\n',
    '2023-03-21T15:58:16.094Z chromeRunner Preparing sandbox [worker #5, session #v1ck4]\n',
    '2023-03-21T15:58:16.102Z browserRunner Total files to load in sandbox: 55\n',
    '2023-03-21T15:58:16.113Z browserRunner Sandbox is generated [worker #5, session #v1ck4]: http://localhost:51136/wallaby_sandbox5.html\n',
    '2023-03-21T15:58:16.114Z chromeRunner Prepared sandbox [worker #0, session #yw2ph]\n',
    '2023-03-21T15:58:16.114Z chromeRunner Prepared sandbox [worker #1, session #pet9z]\n',
    '2023-03-21T15:58:16.114Z chromeRunner Prepared sandbox [worker #2, session #jw0ss]\n',
    '2023-03-21T15:58:16.114Z chromeRunner Prepared sandbox [worker #3, session #mtdnr]\n',
    '2023-03-21T15:58:16.114Z chromeRunner Prepared sandbox [worker #4, session #5ei4x]\n',
    '2023-03-21T15:58:16.114Z chromeRunner Prepared sandbox [worker #5, session #v1ck4]\n',
    '2023-03-21T15:58:16.115Z workers [worker #0, session #yw2ph] Running tests in sandbox\n',
    '2023-03-21T15:58:16.117Z workers [worker #1, session #pet9z] Running tests in sandbox\n',
    '2023-03-21T15:58:16.117Z workers [worker #2, session #jw0ss] Running tests in sandbox\n',
    '2023-03-21T15:58:16.119Z workers [worker #3, session #mtdnr] Running tests in sandbox\n',
    '2023-03-21T15:58:16.120Z workers [worker #4, session #5ei4x] Running tests in sandbox\n',
    '2023-03-21T15:58:16.120Z workers [worker #5, session #v1ck4] Running tests in sandbox\n',
    "2023-03-21T15:58:16.175Z chromeRunner Failed to evaluate code on Chrome Tab: Cannot read properties of undefined (reading 'Runtime')\n",
    "2023-03-21T15:58:16.177Z chromeRunner Failed to evaluate code on Chrome Tab: Cannot read properties of undefined (reading 'Runtime')\n",
    "2023-03-21T15:58:16.178Z chromeRunner Failed to evaluate code on Chrome Tab: Cannot read properties of undefined (reading 'Runtime')\n",
    "2023-03-21T15:58:16.179Z chromeRunner Failed to evaluate code on Chrome Tab: Cannot read properties of undefined (reading 'Runtime')\n",
    "2023-03-21T15:58:16.192Z chromeRunner Failed to evaluate code on Chrome Tab: Cannot read properties of undefined (reading 'Runtime')\n",
    "2023-03-21T15:58:16.193Z chromeRunner Failed to evaluate code on Chrome Tab: Cannot read properties of undefined (reading 'Runtime')\n",
    '2023-03-21T15:58:16.695Z workers [yw2ph] Sandbox is not responsive, recycling worker instance\n',
    '2023-03-21T15:58:16.701Z project Test run finished\n',
    '2023-03-21T15:58:16.701Z workers [pet9z] Sandbox is not responsive, recycling worker instance\n',
    '2023-03-21T15:58:16.701Z workers [jw0ss] Sandbox is not responsive, recycling worker instance\n',
    '2023-03-21T15:58:16.701Z workers [mtdnr] Sandbox is not responsive, recycling worker instance\n',
    '2023-03-21T15:58:16.702Z workers [5ei4x] Sandbox is not responsive, recycling worker instance\n',
    '2023-03-21T15:58:16.702Z workers [v1ck4] Sandbox is not responsive, recycling worker instance\n'
  ]
}
smcenlly commented 1 year ago

Thanks for reporting the problem. This was not a problem with Wallaby, but instead a breaking change in the latest version of Chrome (v.110.0.5481.178) for the chrome remote debugger communication protocol that is required by Wallaby.

This has been fixed in the latest version of Wallaby, v1.0.1394. Please update to the latest version, it will fix your problem.

Alternatively, you may try downloading and explicitly specifying an older version of Chrome for Wallaby to use (set the env.runner configuration setting as described in our docs).

Arthoo commented 1 year ago

Hello @smcenlly,

Could we have an estimation for when this will be available for the VS Code plugin? When I do "Force Core Update" I get v1.0.1360, it looks like it's not very close to v1.0.1394. I guess this could be because I have a license that has expired recently, but does this mean I will not get the fix unless I renew the license?

ArtemGovorov commented 1 year ago

@Arthoo

I guess this could be because I have a license that has expired recently, but does this mean I will not get the fix unless I renew the license?

Yes, your license has expired and the support for the latest chrome remote debugger communication protocol has been added in v1.0.1394 that is not covered by your license. To get the latest version with added support, you'll need to renew your license.

Alternatively, you may try downloading and explicitly specifying an older version of Chrome for Wallaby to use (set the env.runner configuration setting as described in our docs).

FreeBLD commented 1 year ago

Thanks for the support 🙏