How to ignore peer dependencies?

Hi all, I'm using pnpm and turbo with more or less the T3 turbo github template. I've been really struggling with this error from the aws-sdk (Which I'm using to generate presigned urls for my users to upload images to s3):
Import trace for requested module:
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/SignatureV4MultiRegion.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/dist-cjs/index.js
@acme/nextjs:build: ./src/app/api/v1/upload-image/route.ts
@acme/nextjs:build:
@acme/nextjs:build: ../../node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/SignatureV4MultiRegion.js
@acme/nextjs:build: Module not found: Can't resolve '@aws-sdk/signature-v4-crt' in {{My file path}}
Import trace for requested module:
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/SignatureV4MultiRegion.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js
@acme/nextjs:build: ../../node_modules/@aws-sdk/client-s3/dist-cjs/index.js
@acme/nextjs:build: ./src/app/api/v1/upload-image/route.ts
@acme/nextjs:build:
@acme/nextjs:build: ../../node_modules/@aws-sdk/s3-request-presigner/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/SignatureV4MultiRegion.js
@acme/nextjs:build: Module not found: Can't resolve '@aws-sdk/signature-v4-crt' in {{My file path}}
From all my digging (I've been through all the github issues, trust me), these peer dependencies are utterly optional and it's a mistake on the sdk library's side. I can't figure out how tf to suppress the warnings and it's clogging up my console so much it's becoming unusable during development. I'm flailing, trying every set of package.json configurations, etc, but nothing seems to work:
"overrides": {
"aws-crt": "../EXCLUDED"
},
"pnpm": {
"ignoreMissing": [
"@aws-sdk/signature-v4-crt",
"@aws-sdk*",
"encoding",
"*aws*"
],
"peerDependencyRules": {
"ignoreMissing": [
"@aws-sdk/signature-v4-crt",
"@aws-sdk*",
"encoding",
"*aws*"
]
}
},
"overrides": {
"aws-crt": "../EXCLUDED"
},
"pnpm": {
"ignoreMissing": [
"@aws-sdk/signature-v4-crt",
"@aws-sdk*",
"encoding",
"*aws*"
],
"peerDependencyRules": {
"ignoreMissing": [
"@aws-sdk/signature-v4-crt",
"@aws-sdk*",
"encoding",
"*aws*"
]
}
},
Appreciate any and all help, I'm new to dep management, etc.
1 Reply
Endgame1013
Endgame10132y ago
Maybe not the best approach, but I’ve had to cave in on a couple projects and install peers by default. If you create a .npmrc file in at the same level as your package.json, you can copy/paste the following (this seemed to work for me): auto-install-peers=true
Want results from more Discord servers?
Add your server