Getting Error: Webpack Compilation Error in cypress 10.8


This Content is from Stack Overflow. Question asked by diwakar sharma

Error: Webpack Compilation Error
./node_modules/@testing-library/dom/dist/@testing-library/dom.esm.js 429:27
Module parse failed: Unexpected token (429:27)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See
|   // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- types are not aware of older browsers that don't implement `labels`
|   if (element.labels !== undefined) {
>     return element.labels ?? [];
|   }

my package.json file is:

  "name": "svt-automation-ui",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "cy:open": "cypress open"
  "devDependencies": {
    "@cypress/skip-test": "^2.6.1",
    "@testing-library/cypress": "^8.0.2",
    "cypress": "^10.8.0",
    "cypress-iframe": "^1.0.1",
    "cypress-log-to-output": "^1.1.2",
    "cypress-xpath": "^1.6.2"
  "dependencies": {
    "webpack": "^5.74.0"


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?