tools icon indicating copy to clipboard operation
tools copied to clipboard

WCT: "TypeError: Cannot read property 'match' of undefined"

Open super-kamil opened this issue 3 years ago • 3 comments

Hi, suddenly the tests stopped working.

TypeError: Cannot read property 'match' of undefined

Tried different node versions. Same error. Any idea how to debug this to get additional information?

Windows 11 command: wct --npm

wct.conf.json But the error is alway the same. No matter which config.

{
    "plugins": {
        "local": {
            "browsers": [
                "chrome"
            ],
            "browserOptions": {
                "chrome": [
                    "headless",
                    "disable-gpu"
                ]
            }
        },
        "istanbul": {
            "dir": "./coverage",
            "reporters": ["text-summary", "lcov"],
            "include": [
                "**/*.js"
            ],
            "exclude": [
                "/polymer/polymer.js",
                "/platform/platform.js"
            ]
        }
    }
}

super-kamil avatar Feb 14 '22 10:02 super-kamil

TypeError: Cannot read properties of undefined (reading 'match')
    at chrome (C:\Users\info\Projects\xxx\wcs\b-input\node_modules\wct-local\lib\browsers.js:115:36)
    at Object.<anonymous> (C:\Users\info\Projects\xxx\wcs\b-input\node_modules\wct-local\lib\browsers.js:88:38)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\info\Projects\xxx\wcs\b-input\node_modules\wct-local\lib\browsers.js:4:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
/**
 * @param browser A launchpad browser definition.
 * @return A selenium capabilities object.
 */
function chrome(browser, browserOptions) {
    return {
        'browserName': 'chrome',
        'version': browser.version.match(/\d+/)[0],
        'chromeOptions': {
            'binary': browser.binPath,
            'args': browserOptions || ['start-maximized']
        }
    };
}

Browser object:

browser {
  name: 'chrome',
  path: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
  binPath: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
}

Version property is missing.

super-kamil avatar Feb 16 '22 16:02 super-kamil

@super-kamil so what exactly was the fix?

MattAllen31 avatar Jan 04 '23 15:01 MattAllen31

Do we have any fix for this yet? I could see that while installing the web-component-tester module, it tries to install launchpad from forllowing commitin the package.json "dependencies": { "@types/express": "^4.0.30", "@types/freeport": "^1.0.19", "@types/launchpad": "^0.6.0", "@types/which": "^1.3.1", "chalk": "^2.3.0", "cleankill": "^2.0.0", "freeport": "^1.0.4", "launchpad": "git+https://github.com/web-padawan/launchpad.git#fdd994d089572e2c2152d70cc74abf497d08d5b7", "selenium-standalone": "^6.7.0", "which": "^1.0.8" }

was there any specific reason for this? Am I missing something here?

chiragshivam avatar Mar 13 '24 15:03 chiragshivam