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

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/Users/test/Git/UIAutomation/qa-ui-automation/pt/process' #5349

Closed
3 tasks done
praveentata opened this issue Oct 11, 2023 · 3 comments
Assignees
Labels
bug This issue is a bug.

Comments

@praveentata
Copy link

Checkboxes for prior research

Describe the bug

I am running UI tests using Cypress 13.3.0

I am using the following AWS SDK libraries:

I have a test which imports the following AWS libraries:

import {
  CloudFormationClient,
  CreateStackCommand,
  DescribeStacksCommand,
  DeleteStackCommand,
} from '@aws-sdk/client-cloudformation';

When I run the command npx cypress open, I am getting the following error:

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/Users/test/Git/UIAutomation/qa-ui-automation/pt/process'
    required by /Users/test/Git/UIAutomation/qa-ui-automation/pt/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js

package.json

{
  "name": "my-project",
  "version": "1.0.0",
  "description": "E2E UI automation",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@testing-library/cypress": "^10.0.1",
    "chai": "^4.3.6",
    "chai-as-promised": "^7.1.1",
    "cypress-xpath": "^1.6.2",
    "dayjs": "^1.10.6",
    "pretty-format": "^27.0.6"
  },
  "devDependencies": {
    "@aws-sdk/client-cloudformation": "^3.75.0",
    "@aws-sdk/client-ec2": "^3.75.0",
    "@reportportal/agent-js-cypress": "^5.0.3",
    "cypress": "13.3.0",
    "cypress-audit": "^1.0.0",
    "cypress-downloadfile": "^1.2.1",
    "cypress-iframe": "^1.0.1",
    "cypress-localstorage-commands": "^1.6.1",
    "cypress-multi-reporters": "^1.5.0",
    "cypress-tags": "^1.1.2",
    "cypress-wait-until": "^1.7.2",
    "eslint": "^7.32.0",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-cypress": "^2.11.3",
    "eslint-plugin-prettier": "^3.4.0",
    "eslint-plugin-react": "^7.24.0",
    "junit-report-merger": "^3.0.2",
    "mocha-junit-reporter": "^2.0.2",
    "mochawesome": "^7.0.1",
    "mochawesome-merge": "^4.2.1",
    "mochawesome-report-generator": "^6.0.1",
    "prettier": "^2.3.2",
    "typescript": "^4.3.5"
  }
}

SDK version number

@aws-sdk/[email protected], @aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

node -v v18.18.0

Reproduction Steps

Just import any AWS related libraries to any Cypress spec file. For example:

import {
  CloudFormationClient,
  CreateStackCommand,
  DescribeStacksCommand,
  DeleteStackCommand,
} from '@aws-sdk/client-cloudformation';

Observed Behavior

When I run the command npx cypress open, I am getting the following error:

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/Users/test/Git/UIAutomation/qa-ui-automation/pt/process'
    required by /Users/test/Git/UIAutomation/qa-ui-automation/pt/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js

I tried changing this:
const process_1 = require("process"); to const process_1 = require("process/"); - Added / as suggested here: browserify/browserify#1986

After making the change, I got a similar issue for another library aws-crt.
I installed that library and made a similar change in its index.js file which then landed me to this error: #3828

It will be great if someone can provide some pointers on what's going wrong

image

Expected Behavior

Cypress test should be able to identify the import and run the test

Possible Solution

No response

Additional Information/Context

No response

@praveentata
Copy link
Author

So, it seems like the cypress-tags library is causing this issue.
After removing the cypress-tags library, I was able to successfully run the tests.
This library also intereferred with Report Portal autoMerge feature. I was encountering the following error: reportportal/agent-js-cypress#175

@RanVaknin RanVaknin self-assigned this Oct 13, 2023
@RanVaknin RanVaknin removed the needs-triage This issue or PR still needs to be triaged. label Oct 18, 2023
@RanVaknin
Copy link
Contributor

Seems like you isolated the problem. I suggest you contact the cypress-tags maintainers for support regarding this issue.

Thanks,
Ran~

@RanVaknin RanVaknin closed this as not planned Won't fix, can't repro, duplicate, stale Oct 18, 2023
Copy link

github-actions bot commented Nov 2, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants