DrizzyDrake
DrizzyDrake
Explore posts from servers
TTCTheo's Typesafe Cult
Created by DrizzyDrake on 8/11/2024 in #questions
trpc prefetch fails when building app
tRPC fails to get the data when it is build the application as the tRPC server cannot run when building. Any thoughts on how to fix this issue?
export default async function Page() {
void api.catalyst.auth.state.prefetch();
// ...
}
export default async function Page() {
void api.catalyst.auth.state.prefetch();
// ...
}
5 replies
TtRPC
Created by DrizzyDrake on 7/6/2024 in #❓-help
Having great difficulty using Streaming
I wanted to use the stream api with tRPC to handle a response with alot of return values and I looked at the docs for this https://trpc.io/docs/client/react/useQuery#streaming, and when trying to use the example TypeScript gives me the error: Property 'map' does not exist on type 'AsyncGenerator<number, void, unknown>'. and my JavaScript console gives me this error as well, TypeError: _myQuery_data.map is not a function. I am using the T3 Stack with tRPC running Bun 1.1.3 with Next.js v14.2.4
3 replies
TtRPC
Created by DrizzyDrake on 6/24/2024 in #❓-help
Brainstorming how to convert REST api to tRPC
I have a use case where I have a url that looks similar to /stores/:store/items/:items and store could have many sub routes to it. is there any ideas on the best way to convert this into a tRPC route?
3 replies
TTCTheo's Typesafe Cult
Created by DrizzyDrake on 3/24/2024 in #questions
Module not found: Can't resolve '@/components/site/footer' on Vercel
In development this works perfectly fine and it renders correctly, however when I deploy to vercel it throws this error:
Module not found: Can't resolve '@/components/site/footer'
Module not found: Can't resolve '@/components/site/footer'
Here is my tsconfig.json with the path alias set up as "@/*": ["./src/*"]:
{
"compilerOptions": {
/* Base Options: */
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,

/* Strictness */
"strict": true,
"noUncheckedIndexedAccess": true,
"checkJs": true,

/* Bundled projects */
"lib": ["dom", "dom.iterable", "ES2022"],
"noEmit": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "preserve",
"plugins": [{ "name": "next" }],
"incremental": true,

/* Path Aliases */
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": [
".eslintrc.cjs",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.cjs",
"**/*.js",
".next/types/**/*.ts"
],
"exclude": ["node_modules"]
}
{
"compilerOptions": {
/* Base Options: */
"esModuleInterop": true,
"skipLibCheck": true,
"target": "es2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,

/* Strictness */
"strict": true,
"noUncheckedIndexedAccess": true,
"checkJs": true,

/* Bundled projects */
"lib": ["dom", "dom.iterable", "ES2022"],
"noEmit": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"jsx": "preserve",
"plugins": [{ "name": "next" }],
"incremental": true,

/* Path Aliases */
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
},
"include": [
".eslintrc.cjs",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.cjs",
"**/*.js",
".next/types/**/*.ts"
],
"exclude": ["node_modules"]
}
4 replies
TTCTheo's Typesafe Cult
Created by DrizzyDrake on 3/23/2024 in #questions
Get a list of all files in UploadThing
I looked through some of the documentation for UploadThing, and I see how to upload a file, but what about downloading or getting a list of all the files that are uploaded?
3 replies
KPCKevin Powell - Community
Created by DrizzyDrake on 7/30/2023 in #front-end
JS Geolocation provider did not provide a good position
Uhh so I implemented code a while back that used geolocation and it worked then but now it throws a GeolocationPositionError that the message is Network location provider at 'https://inference.location.live.net/' : Did not provide a good position fix. with error code 2. This is a snippet of the code (yes, the code runs after user input):
let latLong = [0, 0];
latLong = await new Promise(async (res, rej) => {
await navigator.geolocation.getCurrentPosition(
(ret) => {
res([ret.coords.latitude, ret.coords.longitude]);
},
(err) => {
rej(err);
});
});
console.log('latlng', latLong);
let latLong = [0, 0];
latLong = await new Promise(async (res, rej) => {
await navigator.geolocation.getCurrentPosition(
(ret) => {
res([ret.coords.latitude, ret.coords.longitude]);
},
(err) => {
rej(err);
});
});
console.log('latlng', latLong);
2 replies