Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
super-kamil opened this issue Feb 14, 2022 · 3 comments
Open

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

super-kamil opened this issue Feb 14, 2022 · 3 comments

Comments

@super-kamil
Copy link

super-kamil commented Feb 14, 2022

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
Copy link
Author

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.

@MattAllen31
Copy link

@super-kamil so what exactly was the fix?

@chiragshivam
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants