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
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