badeball / cypress-cucumber-preprocessor

Run cucumber/gherkin-syntaxed specs with Cypress
MIT License
1.32k stars 147 forks source link

@badeball/cypress-cucumber-preprocessor/browserify doesn't work with aws-amplify latest versions (since v4.3.8) #1036

Closed anna-mk closed 1 year ago

anna-mk commented 1 year ago

Current behavior

An error occurs when bundling JavaScript via Browserify preprocessor

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/Users/Anna_Mkrtchyan/WebstormProjects/cypress-cucumber-browserify-amplify-issue/process' required by /Users/Anna_Mkrtchyan/WebstormProjects/cypress-cucumber-browserify-amplify-issue/node_modules/@aws-sdk/client-lex-runtime-v2/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js

Desired behavior

I should be able to bundle JS code with browserify when using aws-amplify to authorize my Cognito user in autotests.

Test code to reproduce

  1. Clone repository - https://github.com/anna-mk/cypress-cucumber-browserify-amplify-issue
  2. Install dependencies - npm i
  3. Create cypress.env.json file in the project's root directory and add Cognito user credentials to it. It should look like { "PASSWORD": "", "USERNAME": "", "POOL_ID": "", "CLIENT_ID": "" }
  4. Run code - npm test

Notes

  1. I simplified the code to the minimum reproducible state. Removed Cucumber related code.
  2. Issue started to occur since aws-amplify v4.3.8.
  3. The file mentioned in the error log is unnecessary and unknown for the project.

Versions

Checklist

badeball commented 1 year ago

I should be able to bundle JS code with browserify when using aws-amplify to authorize my Cognito user in autotests.

This might very well be true, but it's not my problem and I can't help you with it. It also seems to be a known issue.