- Newest
- Most votes
- Most comments
The error you're encountering suggests a problem with the lru-cache module, which is likely causing issues with the AWS CDK deployment process. This error can occur due to version incompatibilities or incorrect module resolution. Here are some steps you can try to resolve the issue:
-
Update the
lru-cachepackage: In your rootpackage.json, you've already specified an override forlru-cacheto version 10.0.1. Make sure this override is applied correctly by runningpnpm installagain. -
Clear your node_modules and reinstall: Run the following commands in your project root:
pnpm clean pnpm install -
Check for conflicting versions: Ensure that there are no conflicting versions of
lru-cachein your dependencies. You can usepnpm list lru-cacheto check for any duplicate installations. -
Update AWS CDK and related packages: Make sure you're using the latest compatible versions of AWS CDK and related packages. Update them if necessary.
-
Verify TypeScript configuration: Ensure that your
tsconfig.jsonfiles (both root and amplify) are correctly configured, especially themoduleResolutionsetting. For the roottsconfig.json, try changing"moduleResolution": "bundler"to"moduleResolution": "node". -
Check for circular dependencies: Review your code for any potential circular dependencies, as these can sometimes cause unexpected errors during the build process.
-
Verify Node.js version: Ensure you're using a Node.js version compatible with your project dependencies. Your
package.jsonspecifies Node.js 22.0.0, which is quite recent. Consider using an LTS version like 18.x or 20.x if you continue to have issues.
If these steps don't resolve the issue, you may need to investigate further by examining the full stack trace and potentially reaching out to AWS Amplify support for more specific guidance.
Sources
Troubleshoot circular dependency issues - AWS Amplify Gen 2 Documentation
Troubleshoot "Stack CDKToolkit already exists" - React - AWS Amplify Gen 2 Documentation
answered a year ago
Relevant content
asked 3 years ago
asked a year ago
- AWS OFFICIALUpdated 5 years ago
