Dave
Dave
TTCTheo's Typesafe Cult
Created by Dave on 7/12/2023 in #questions
How to prefix planetscale tables for dev dbs using drizzle?
I remember Theo talking about a clever workaround for the planetscale db/project limit by making specially prefixed table names in dev mode. In order to "emulate" a dev db you could just make extra tables and conditionally access them based on the build environment. I loosely remember drizzle being mentioned - anyone remember this or can point me in the right direction? I was hoping there was a more clever way to do this than doubling my code with two adjacent conditional queries , and rather something I could handle with smart configuration.
5 replies
TTCTheo's Typesafe Cult
Created by Dave on 5/21/2023 in #questions
Does anyone have a working example of geolocating using nextjs's req.geo or 'x-vercel-ip-xxxx'?
1 replies
TTCTheo's Typesafe Cult
Created by Dave on 3/29/2023 in #questions
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.
2 replies