Closed calebpollman closed 2 months ago
This was also seen in https://github.com/aws/aws-sdk-js-v3/issues/3354 and I'm running into it as well.
Hey @calebpollman thanks for opening this issue and setting up repo for repro as well. Do you see similar errors when not using cypress? Could also be related to webpack bundling too, I'll post more findings once I run the code.
Thanks for picking this up @ajredniwja. It is specific to Cypress
I'm also getting this same issue when running tests with jest
@ajredniwja Any updates?
I am getting a similar problem when mocking the "fs" module in Jest.
Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/Users/Guest/X-Project/API-Automation/process' required by /Users/Guest/X-Project/API-Automation/node_modules/@aws-sdk/client-pinpoint/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js is this issue related to bug? I try to install "npm install @aws-sdk/client-pinpoint" and see this error
Hi there,
The error observed here is likely not an issue with the SDK. It seems like Cypress is attempting to resolve functionalities from the fs
module which is not supported in a browser environment. As a user of Cypress you'll likely have to shim it, or use something like https://www.npmjs.com/package/@cypress/webpack-preprocessor to pre process with webpack.
Thanks, Ran~
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.
Describe the bug
The @aws-sdk/shared-ini-file-loader package (and potentially others) includes destructuring of
fs
, a Node API in a couple files (here and here) which isundefined
in the context of a browser. While this package is clearly not meant for browser usage, it is included as a dependency of some AWS SDK clients (for example @aws-sdk/client-pinpoint) which are.Just having this package in our
node_modules
via installation of @aws-sdk/client-pinpoint is causing a Cypress test to crash when we attempt to import an unrelated package (see here)Expected Behavior
Inclusion of the @aws-sdk/client-pinpoint package within an application's _nodemodules should not break Cypress
Current Behavior
Reproduction Steps
Sample repo with directions: https://github.com/calebpollman/cypress-aws-sdk
Possible Solution
Only destructure the Node API contents within the scope of the functions that require their usage, example:
Additional Information/Context
No response
SDK version used
3.x
Environment details (OS name and version, etc.)
macOS Monterey, version 12.4