whatplan
whatplan
Explore posts from servers
DTDrizzle Team
Created by whatplan on 9/22/2023 in #help
`tablesFilter` cli arg "unknown option"
from the 'help' message
--tablesFilter Table name filters
--tablesFilter Table name filters
but I can't seem to figure out how to use it
error: unknown option '--tablesFilter=!libsql_wasm_func_table'
error: "drizzle-kit" exited with code 1 (SIGHUP)
error: unknown option '--tablesFilter=!libsql_wasm_func_table'
error: "drizzle-kit" exited with code 1 (SIGHUP)
error: unknown option '--tablesFilter="!libsql_wasm_func_table"'
error: "drizzle-kit" exited with code 1 (SIGHUP)
error: unknown option '--tablesFilter="!libsql_wasm_func_table"'
error: "drizzle-kit" exited with code 1 (SIGHUP)
error: unknown option '--tablesFilter "!libsql_wasm_func_table"'
error: "drizzle-kit" exited with code 1 (SIGHUP)
error: unknown option '--tablesFilter "!libsql_wasm_func_table"'
error: "drizzle-kit" exited with code 1 (SIGHUP)
error: unknown option '--tablesFilter !libsql_wasm_func_table'
error: "drizzle-kit" exited with code 1 (SIGHUP)
error: unknown option '--tablesFilter !libsql_wasm_func_table'
error: "drizzle-kit" exited with code 1 (SIGHUP)
any help greatly appriciated thank you
22 replies
DTDrizzle Team
Created by whatplan on 5/28/2023 in #help
in drizzle.config.ts: "Cannot use import statement outside a module"
happens when I try to push
import type { Config } from "drizzle-kit";
import { env } from "~/env.mjs";

export default {
schema: "./src/db/schema.ts",
host: env.DATABASE_HOST,
user: env.DATABASE_USERNAME,
password: env.DATABASE_PASSWORD,
} satisfies Config;
import type { Config } from "drizzle-kit";
import { env } from "~/env.mjs";

export default {
schema: "./src/db/schema.ts",
host: env.DATABASE_HOST,
user: env.DATABASE_USERNAME,
password: env.DATABASE_PASSWORD,
} satisfies Config;
env.mjs zod validates the raw process.env any assistance is very much appreciated thanks
9 replies
TTCTheo's Typesafe Cult
Created by whatplan on 5/11/2023 in #questions
turborepo: bin of local package not resolving properly
/packages/next-typesafe-url/package.json
// ...
"bin": "./dist/cli.js",
"typings": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./server": {
"require": "./dist/server.js",
"import": "./dist/server.mjs"
},
"./client": {
"require": "./dist/client.js",
"import": "./dist/client.mjs"
}
},
// ...
// ...
"bin": "./dist/cli.js",
"typings": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
},
"./server": {
"require": "./dist/server.js",
"import": "./dist/server.mjs"
},
"./client": {
"require": "./dist/client.js",
"import": "./dist/client.mjs"
}
},
// ...
/turbo.json
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
}
}
}
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**", "!.next/cache/**"]
},
"lint": {
"outputs": []
},
"dev": {
"cache": false
}
}
}
Issue: in my example app, I import the package
"next-typesafe-url": "workspace:*",
"next-typesafe-url": "workspace:*",
the library code is imported and runs fine, except whenever I run npx next-typesafe-url to use my cli it doesnt go the the dist folder I have listed under bin in my package.json
PS C:\next-typesafe-url\examples\pagesdir> npx next-typesafe-url
node:internal/modules/cjs/loader:959
throw err;
^

Error: Cannot find module 'C:\next-typesafe-url\packages\next-typesafe-url\cli.ts'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
PS C:\next-typesafe-url\examples\pagesdir> npx next-typesafe-url
node:internal/modules/cjs/loader:959
throw err;
^

Error: Cannot find module 'C:\next-typesafe-url\packages\next-typesafe-url\cli.ts'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
any help is appreciated thanks
1 replies
TTCTheo's Typesafe Cult
Created by whatplan on 3/1/2023 in #questions
Client Side Routing to specific route causes 'too many rerenders', but a page reload works fine
Going straight to link and getting brand new page from server works fine using next Link component to route client side causes Error: Too many re-renders. only 1 specific page, all others work and this page is nearly identical to others in terms of functionality
2 replies
TTCTheo's Typesafe Cult
Created by whatplan on 2/23/2023 in #questions
"Unsafe call of an `any` typed value." but everything is typed
2 replies
TTCTheo's Typesafe Cult
Created by whatplan on 2/22/2023 in #questions
"The AWS Access Key Id you provided does not exist in our records."..but I have the right access key
Trying to use the S3 SDK.
export const s3 = new S3({
region: env.REGION,
credentials: {
accessKeyId: env.WASABI_ACCESS_KEY_ID,
secretAccessKey: env.WASABI_SECRET_ACCESS_KEY,
},
});

...

getObjects: publicProcedure.query(async ({ ctx }) => {
const { s3 } = ctx;
const listObjectsOutput = await s3.listObjectsV2({
Bucket: env.BUCKET_NAME,
});

return listObjectsOutput.Contents ?? [];
})
export const s3 = new S3({
region: env.REGION,
credentials: {
accessKeyId: env.WASABI_ACCESS_KEY_ID,
secretAccessKey: env.WASABI_SECRET_ACCESS_KEY,
},
});

...

getObjects: publicProcedure.query(async ({ ctx }) => {
const { s3 } = ctx;
const listObjectsOutput = await s3.listObjectsV2({
Bucket: env.BUCKET_NAME,
});

return listObjectsOutput.Contents ?? [];
})
env:
WASABI_ACCESS_KEY_ID=""
WASABI_SECRET_ACCESS_KEY=""
BUCKET_NAME=""
REGION=""
WASABI_ACCESS_KEY_ID=""
WASABI_SECRET_ACCESS_KEY=""
BUCKET_NAME=""
REGION=""
❌ tRPC failed on wasabi.getObjects: The AWS Access Key Id you provided does not exist in our records.
I deleted and recreated the access keys multiples times making sure they were copied over perfectly. Its such a dumb error because its clear whats wrong, the access key is invalid. But I know its the one I got from wasabi... Any help is appriciated thanks
2 replies
TTCTheo's Typesafe Cult
Created by whatplan on 12/24/2022 in #questions
NextAuth-Try signing in with a different account
1 replies
TTCTheo's Typesafe Cult
Created by whatplan on 12/23/2022 in #questions
Confused on types of prisma responses, and how to access the data inside.
The NextAuth 'Account' model in prisma has a 'access_token' property that I need to access for a API call on the server. However, the only property I can access in the trpc context is the "session" model. So, what I am doing is querying users for the user that has the session from the context, then getting the account array from that user and getting the account from there. (1st image) However, I am running into some issues mainly with the type of what prisma calls return back. When I hover I get this big type (2nd image) that appears to have a "accounts" property, but then when I hover over accounts I dont get the "Account[]" I expect, instead some long obscure type (3rd image) however, when simply return the prisma result from trpc (4th image), and do the same thing as before with getting the account on client (5th image) everything works, but id like to keep this all on the server if possible so this isnt ideal. Im pretty new and probably doing something wrong, any help is greatly appreciated thanks
8 replies