fossfighter
fossfighter
Explore posts from servers
WWasp-lang
Created by fossfighter on 7/16/2023 in #🙋questions
Typed jobs
Is there a way to get generated type of function for a job like we do with queries?
5 replies
WWasp-lang
Created by fossfighter on 5/9/2023 in #🙋questions
Error: secretOrPrivateKey must have a value
No description
14 replies
WWasp-lang
Created by fossfighter on 5/8/2023 in #🙋questions
accessing env on client
I've put const variable to shared folder to read env. When importing it from @wasp/shared on server side it works fine but with client I'm getting
ReferenceError: process is not defined
ReferenceError: process is not defined
in browser. So, how to read env on client?
31 replies
WWasp-lang
Created by fossfighter on 5/4/2023 in #🙋questions
public media folder
I am making a job which generates images. After generating, I want them to be publicly accessible. Where is a good folder in project to place them so it will work? I'm planning to deploy on Fly
7 replies
WWasp-lang
Created by fossfighter on 5/3/2023 in #🙋questions
Queries/Actions type
Can I get generated type for context of queries/actions? Docs examples for them are in JS which ruins the following use of them on client. Currently there is example with self-defined types (https://github.com/wasp-lang/wasp/blob/release/examples/todo-typescript/src/server/serverTypes.ts) but it looks like temporary solution
5 replies
TtRPC
Created by fossfighter on 4/27/2023 in #âť“-help
How to properly check the contents of prefetched data?
I have dynamic route with SSG and if coming product slug is not in db I want to return notFound: true after prefetching. How to do it the right way? Right now I'm doing it like this but it looks like hack export const getStaticProps: GetStaticProps = async (ctx) => { const ssg = await createServerSideHelpers({ router: appRouter, ctx: await createContext(), transformer: superjson, }); await ssg.public.product.prefetch({ slug: ctx.params?.slug as string, }); const product = ssg.dehydrate().json.queries[0].state.data; if (!product) { return { notFound: true, }; } return { props: { trpcState: ssg.dehydrate(), slug: ctx.params?.slug, }, }; };
3 replies