HAL 9000
HAL 9000
Explore posts from servers
TTCTheo's Typesafe Cult
Created by HAL 9000 on 5/16/2024 in #questions
Vite config ts cannot import `resolve`
hey guys. How can I import resolve from path in vite.config.ts?
2 replies
DTDrizzle Team
Created by HAL 9000 on 1/25/2024 in #help
aliased joins
I am making a select query with 2 inner joins, I want to use two joined tables with different conditions.
3 replies
DTDrizzle Team
Created by HAL 9000 on 1/22/2024 in #help
Magic sql`` operator array
hey guys. how can I pass a array fo strings to magic sql operator?
16 replies
DTDrizzle Team
Created by HAL 9000 on 1/1/2024 in #help
neondb/serverless postgresql JSONB insert example
There is no example of how to insert jsonb column to the table? Do I have to serialize object before inserting?
6 replies
DTDrizzle Team
Created by HAL 9000 on 12/22/2023 in #help
cannot push
error: relation "users" does not exist
at /home/ahmetkca/Projects/Oymak/overi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:24545:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PgPostgres.query (/home/ahmetkca/Projects/Oymak/overi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:25506:21)
at async pgSuggestions (/home/ahmetkca/Projects/Oymak/overi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:25822:23)
at async Command.<anonymous> (/home/ahmetkca/Projects/Oymak/overi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:63139:11) {
length: 104,
severity: 'ERROR',
code: '42P01',
detail: undefined,
hint: undefined,
position: '31',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '1449',
routine: 'parserOpenTable'
}
error: relation "users" does not exist
at /home/ahmetkca/Projects/Oymak/overi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:24545:21
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async PgPostgres.query (/home/ahmetkca/Projects/Oymak/overi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:25506:21)
at async pgSuggestions (/home/ahmetkca/Projects/Oymak/overi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:25822:23)
at async Command.<anonymous> (/home/ahmetkca/Projects/Oymak/overi/node_modules/.pnpm/[email protected]/node_modules/drizzle-kit/bin.cjs:63139:11) {
length: 104,
severity: 'ERROR',
code: '42P01',
detail: undefined,
hint: undefined,
position: '31',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '1449',
routine: 'parserOpenTable'
}
16 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/6/2022 in #questions
tRPC Subscription WebSockets can't subscribe
TRPCClientError: Unexpected request method PATCH
TRPCClientError: Unexpected request method PATCH
2 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
i am throwing TRPCError from trpc mutation how can I handle it on the client I am getting 1 of 1 Unhandled Error
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/4/2022 in #questions
tRPC and WebSockets
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/env/server.mjs not supported.

Instead change the require of /home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/env/server.mjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/server/db/client.ts:6:22)
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/env/server.mjs not supported.

Instead change the require of /home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/env/server.mjs to a dynamic import() which is available in all CommonJS modules.
at Object.<anonymous> (/home/xxxxx/Projects/xxxxxxx/xxxxxxx/src/server/db/client.ts:6:22)
how can I dynamically import env from /env/server/mjs ? ts-node-dev --project tsconfig.server.json --respawn --transpile-only --ignore-watch node_modules --no-notify --exit-child src/server/wsServer.ts
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"target": "ES2019",
"lib": ["ES2019", "DOM"],
"isolatedModules": false,
"noEmit": false
},
"include": ["next-env.d.ts", "src/**/*.ts", "src/**/*.tsx"]
}
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"target": "ES2019",
"lib": ["ES2019", "DOM"],
"isolatedModules": false,
"noEmit": false
},
"include": ["next-env.d.ts", "src/**/*.ts", "src/**/*.tsx"]
}
import { env } from "../../env/server.mjs";
import { env } from "../../env/server.mjs";
27 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 9/20/2022 in #questions
Lightweight Message Queue for Long running Background Tasks
I have a nextjs application I want to queue jobs. Essentially I want to queue a job and then I would create that job in the database associated with the user then I would get back its id. User will be able to check its status by its job id later on and once it is finished the the that had been queue will call my nextjs api endpoint to trigger a series of actions which might be store the result of the job in a database.
26 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 9/20/2022 in #questions
T3 Stack NextAuth How to get Provider access token
I have one question I have T3 Stack, PrismaAdapter, GithubProvider How can I get access token from Github Provider?
callbacks: {
async session({ session, user, token}) {
},
async jwt({ token, user, account, profile, isNewUser }) {
if (user) {
token.id = user.id;
}
return token;
}
}
callbacks: {
async session({ session, user, token}) {
},
async jwt({ token, user, account, profile, isNewUser }) {
if (user) {
token.id = user.id;
}
return token;
}
}
I am trying to get github access token and preserve it I am new to Next.js, NextAuth and T3 stack if I use adapter does it bypass jwt ?
26 replies