cypress icon indicating copy to clipboard operation
cypress copied to clipboard

DEBUG log error message incorrectly claims WebKit is enabled

Open MikeMcC399 opened this issue 1 year ago • 2 comments

Current behavior

Although experimentalWebKitSupport is undefined and defaults to false DEBUG setting with cypress:server:browsers:utils logs an error

cypress:server:browsers:utils WebKit is enabled, but there was an error constructing the WebKit browser: { err: Error: Cannot find module 'playwright-webkit' Require stack: - /home/mike/.cache/Cypress/13.14.2/Cypress/resources/app/packages/server/lib/browsers/utils.ts at node:internal/modules/cjs/loader:1084:15 at Function._resolveFilename (node:electron/js2c/browser_init:2:116118) at resolve (node:internal/modules/cjs/helpers:127:19) at Function.resolve (evalmachine.:1:758945) at P (:2753:103503) at Object.I [as get] (:2753:104338) at W (:2844:92715) at Object.J (:2844:95421) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/mike/.cache/Cypress/13.14.2/Cypress/resources/app/packages/server/lib/browsers/utils.ts' ] } } +0ms

Desired behavior

If experimentalWebKitSupport is undefined or set to to false, there should be no WebKit browser error in the debug logs. This is a misleading message.

Test code to reproduce

Execute:

git clone https://github.com/cypress-io/github-action
cd github-action
cd examples/basic
npm ci
DEBUG=cypress:server:browsers:utils,cypress:config:browser npx cypress run

Cypress Version

First reported on version: 13.14.2 Continues to be reproducible on version: 14.1.0

Node version

v20.17.0 and v22.14.0 LTS

Operating System

Ubuntu 22.04.5 LTS & 24.04.2 LTS

Debug Logs

experimentalWebKitSupport: false,

 ...

  cypress:config:browser validating configuration {} +3ms
  cypress:server:browsers:utils searching for browser { nameOrPath: 'electron', filter: { name: 'electron', channel: 'stable' }, knownBrowsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '128.0.6613.137', path: 'google-chrome', minSupportedVersion: 64, majorVersion: '128' }, { name: 'chromium', family: 'chromium', channel: 'stable', displayName: 'Chromium', version: '128.0.6613.119', path: 'chromium', profilePath: '/home/mike/snap/chromium/current', minSupportedVersion: 64, majorVersion: '128' }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', version: '130.0', path: 'firefox', profilePath: '/home/mike/snap/firefox/current', minSupportedVersion: 86, majorVersion: '130' }, { name: 'edge', family: 'chromium', channel: 'stable', displayName: 'Edge', version: '128.0.2739.67', path: 'microsoft-edge', minSupportedVersion: 79, majorVersion: '128' }, { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '118.0.5993.159', path: '', majorVersion: 118 } ] } +319ms
  cypress:server:browsers:utils getBrowsers +17ms
  cypress:server:browsers:utils WebKit is enabled, but there was an error constructing the WebKit browser: { err: Error: Cannot find module 'playwright-webkit' Require stack: - /home/mike/.cache/Cypress/13.14.2/Cypress/resources/app/packages/server/lib/browsers/utils.ts     at node:internal/modules/cjs/loader:1084:15     at Function._resolveFilename (node:electron/js2c/browser_init:2:116118)     at resolve (node:internal/modules/cjs/helpers:127:19) at Function.resolve (evalmachine.<anonymous>:1:758945) at P (<embedded>:2753:103503) at Object.I [as get] (<embedded>:2753:104338) at W (<embedded>:2844:92715) at Object.J (<embedded>:2844:95421) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/mike/.cache/Cypress/13.14.2/Cypress/resources/app/packages/server/lib/browsers/utils.ts' ] } } +0ms

Other

No response

MikeMcC399 avatar Sep 12 '24 12:09 MikeMcC399

@MikeMcC399 Yah this is not the best wording. I would just remove the 'Webkit is enabled, but ' part entirely

jennifer-shehane avatar Sep 16 '24 17:09 jennifer-shehane

@jennifer-shehane

I would just remove the 'Webkit is enabled, but ' part entirely

Changing the text would remove the inconsistency in the error message, however the bigger question is why it's trying to find the WebKit browser when WebKit is disabled.

MikeMcC399 avatar Sep 17 '24 06:09 MikeMcC399