Crypto Module Error when using AWS4Axios

0

I am using the aws4-axios package for authentication on a React App. I am using this package in order to authenticate an API call with AWS credentials. When I attempt to start the app, I receive an error about the crypto module. I have attempted to remediate this issue by setting crypto to false in my package.json but the error still occurs. If anyone could help, I would deeply appreciate it.

I am inserting the error below.

ERROR in ./node_modules/aws4/aws4.js 4:13-30
Module not found: Error: Can't resolve 'crypto' in '/mnt/c/Users/dalade/code/repos/prism/prism-dashboard/node_modules/aws4'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
        - add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
        - install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
        resolve.fallback: { "crypto": false }

webpack compiled with 1 error
AWS
David A
질문됨 2년 전54회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인