HAL 9000
HAL 9000
Explore posts from servers
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
Oh ok it is because I forgot the await and since it is async mutate
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
const {
mutateAsync: assignPotToUser,
isLoading: isLoading_assignPotToUser,
isError: isError_assignPotToUser,
error: error_assignPotToUser,
isSuccess: isSuccess_assignPotToUser,
} = trpc.useMutation("potes.assignPotToUser", {
retry: 0,
onSuccess: (data) => {
setPotMutationResult(data);
},
onError: (error) => {
console.log(error); // <-------------- Works but still causes Unhandled Runtime Error
}
});
const {
mutateAsync: assignPotToUser,
isLoading: isLoading_assignPotToUser,
isError: isError_assignPotToUser,
error: error_assignPotToUser,
isSuccess: isSuccess_assignPotToUser,
} = trpc.useMutation("potes.assignPotToUser", {
retry: 0,
onSuccess: (data) => {
setPotMutationResult(data);
},
onError: (error) => {
console.log(error); // <-------------- Works but still causes Unhandled Runtime Error
}
});
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
and it does catch the error but still causes thise Unhandled Runtime Error
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
how ever i do have onError on the trpc.useMutation
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
it doesn't catch
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
it i already in the try catch block
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
<Button
pill={true}
outline={true}
color="gray"
size="sm"
onClick={() => {
try {
assignPotToUser({
poteNumber,
});
} catch (error) {
console.log("what the F!@#$#");
}
}}
disabled={isLoading_assignToteToPicker}
>
<Button
pill={true}
outline={true}
color="gray"
size="sm"
onClick={() => {
try {
assignPotToUser({
poteNumber,
});
} catch (error) {
console.log("what the F!@#$#");
}
}}
disabled={isLoading_assignToteToPicker}
>
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
how should I handle it in the client side?
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
@Samathingamajig I am basically throwing trpc.TRPCError from mutation router
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/5/2022 in #questions
[Solved] Unhandled Runtime Error
is this because I am runnning in dev ?
15 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/4/2022 in #questions
tRPC and WebSockets
thanks
27 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/4/2022 in #questions
tRPC and WebSockets
after I added the NODE_ENV=development to .env it works now
27 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/4/2022 in #questions
tRPC and WebSockets
yea I figured when I run nextjs with yarn dev i don't actually set it manually neither yarn dev sets it (next dev sets it to dev under the hood i guess)
27 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/4/2022 in #questions
tRPC and WebSockets
❌ Invalid environment variables:
NODE_ENV: Required

/home/xxxx/xxxx/xxxx/xxxx/src/env/server.mjs:17
throw new Error("Invalid environment variables");
^

Error: Invalid environment variables
at Object.<anonymous> (/home/xxxx/xxxx/xxxx/xxxx/src/env/server.mjs:17:9)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.v (/home/xxxx/xxxx/xxxx/xxxx/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:933)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (//home/xxxx/xxxx/xxxx/xxxx/src/server/db/client.ts:6:21)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.v (/home/xxxx/xxxx/xxxx/xxxx/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:933)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
❌ Invalid environment variables:
NODE_ENV: Required

/home/xxxx/xxxx/xxxx/xxxx/src/env/server.mjs:17
throw new Error("Invalid environment variables");
^

Error: Invalid environment variables
at Object.<anonymous> (/home/xxxx/xxxx/xxxx/xxxx/src/env/server.mjs:17:9)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.v (/home/xxxx/xxxx/xxxx/xxxx/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:933)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (//home/xxxx/xxxx/xxxx/xxxx/src/server/db/client.ts:6:21)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.v (/home/xxxx/xxxx/xxxx/xxxx/node_modules/@esbuild-kit/cjs-loader/dist/index.js:1:933)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
27 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/4/2022 in #questions
tRPC and WebSockets
@flicknote I am getting Invalid Environment Variable error
27 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/4/2022 in #questions
tRPC and WebSockets
dev
27 replies
TTCTheo's Typesafe Cult
Created by HAL 9000 on 10/4/2022 in #questions
tRPC and WebSockets
yea i know
27 replies