BILLY
BILLY
TTCTheo's Typesafe Cult
Created by BILLY on 3/17/2024 in #questions
DANGEROUS__uploadFiles
so I've got to make an API and do that shi, rather not...
3 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
yeah, it works. thanks for pointing that out for me.
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
trying a different version now
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
work make me use 16 I forget...
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
No description
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
tried the latest version of uploadthing and ^5.3.3 as it worked previously in another project. tried the latest version of @uploadthing/react and ^5.3.0 as it worked previously in another project
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
env has correct keys
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
import { createNextRouteHandler } from "uploadthing/next";

import { ourFileRouter } from "./core";

export const { GET, POST } = createNextRouteHandler({
router: ourFileRouter,
});
import { createNextRouteHandler } from "uploadthing/next";

import { ourFileRouter } from "./core";

export const { GET, POST } = createNextRouteHandler({
router: ourFileRouter,
});
route.ts
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
import { createUploadthing, type FileRouter } from "uploadthing/next";
import {getSession} from "@/lib/session";

const f = createUploadthing();
export const ourFileRouter = {
imageUploader: f({ image: { maxFileSize: "4MB" } })
.middleware(async ({ req }) => {
let user = await getSession();
if (!user || !user.admin) throw new Error("Unauthorized");
return { userId: user.id };
})
.onUploadComplete(async ({ metadata, file }) => {
console.log("Upload complete for userId:", metadata.userId);
console.log("file url", file.url);
}),
} satisfies FileRouter;

export type OurFileRouter = typeof ourFileRouter;
import { createUploadthing, type FileRouter } from "uploadthing/next";
import {getSession} from "@/lib/session";

const f = createUploadthing();
export const ourFileRouter = {
imageUploader: f({ image: { maxFileSize: "4MB" } })
.middleware(async ({ req }) => {
let user = await getSession();
if (!user || !user.admin) throw new Error("Unauthorized");
return { userId: user.id };
})
.onUploadComplete(async ({ metadata, file }) => {
console.log("Upload complete for userId:", metadata.userId);
console.log("file url", file.url);
}),
} satisfies FileRouter;

export type OurFileRouter = typeof ourFileRouter;
core.ts
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
No description
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
No description
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 9/28/2023 in #questions
uploadthing error
No description
15 replies
TTCTheo's Typesafe Cult
Created by BILLY on 8/12/2023 in #questions
Lucide react
Absolute legend! Thanks everyone.
5 replies
TTCTheo's Typesafe Cult
Created by BILLY on 6/6/2023 in #questions
Stripe Webhooks (NextJS App Router)
Better to ask in stripe discord... apologies.
7 replies
TTCTheo's Typesafe Cult
Created by BILLY on 5/8/2023 in #questions
Next.js metadata title template
Only works in server components
7 replies
TTCTheo's Typesafe Cult
Created by BILLY on 5/8/2023 in #questions
Next.js metadata title template
I removed the backticks & it still doesn't work. Not sure what you mean by template strings are not used, are you saying template strings do not work? NextJS Docs https://nextjs.org/docs/app/api-reference/functions/metadata#metadata-fields
7 replies