question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module not found: Error: Can't resolve '@cypress/xpath'

See original GitHub issue

Current behavior

Followed instructions for installing @cypress/xpath included require('@cypress/xpath') in support file. Encountered error running tests in Electron (but browser isnt really relevent):

Error: Webpack Compilation Error
Module not found: Error: Can't resolve '@cypress/xpath'

Desired behavior

Update package.json in @cypress/xpath to export correctly

Test code to reproduce

  1. npm install -D @cypress/xpath
  2. add require('@cypress/xpath'); to support file
  3. run tests

Cypress Version

10.6.0

Node version

v16.14.0

Operating System

macOS 12.6

Debug Logs

No response

Other

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
olga-fluencecommented, Oct 14, 2022

I’m also facing the same issue, following steps in readme

1reaction
hugohhernandez76commented, Oct 22, 2022

I was able to resolve the issue by:

  1. ran command npm install -D cypress-xpath

  2. in the folder cypress/support/e2e at the top of the file typed require(‘cypress-xpath’); Screen Shot 2022-10-22 at 9 17 10

  3. and at the cypress/e2e in my test at the top I placed the following command /// <reference types="cypress-xpath" /> Screen Shot 2022-10-22 at 9 18 00

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve cypress error when installing first time
Assuming that the cypress-xpath plugin is already installed, Under cypress/support/e2e.js you have to add this: require('cypress-xpath');.
Read more >
cypress-xpath - npm
Adds XPath command to Cypress test runner. ... Start using cypress-xpath in your project by running `npm i cypress-xpath`.
Read more >
cypress-xpath - npm Package Health Analysis - Snyk
The npm package cypress-xpath was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >
Module not found: Error: Can't resolve 'cypress-file-upload' in ...
I use a npm package called 'cypress-file-upload' and import it in the index. js file within cypress/support. In the bitbucket-pipelines.
Read more >
How to install Xpath plugin in Cypress : Tutorial 4 - YouTube
This video contains how to install xpath plugin in Cypress.You can follow me on Facebook ... Your browser can't play this video.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found