Huperniketes
Huperniketes
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Huperniketes on 6/13/2024 in #questions
How do I map next.config.js code samples in the Next docs to T3's implementation?
Before your answer, I had resorted to defining the headers function outside config's definition:
async function
headers()
{
return [
{
source: "/about",
headers: [
{
key: "x-custom-header",
value: "my custom header value",
},
{
key: "x-another-custom-header",
value: "my other custom header value",
},
],
}
]
}

const config = {
headers: headers,
};
async function
headers()
{
return [
{
source: "/about",
headers: [
{
key: "x-custom-header",
value: "my custom header value",
},
{
key: "x-another-custom-header",
value: "my other custom header value",
},
],
}
]
}

const config = {
headers: headers,
};
But that's pretty kludgy for a single entry in the config declaration.
7 replies
TTCTheo's Typesafe Cult
Created by Huperniketes on 6/13/2024 in #questions
How do I map next.config.js code samples in the Next docs to T3's implementation?
That works well, thanks! Especially with the JsDoc type specifier.
7 replies
TTCTheo's Typesafe Cult
Created by Huperniketes on 5/13/2024 in #questions
t3 workflow?
Changes in node_modules aren't picked up without modifying the next.conf.js config, which causes the server to be restarted. You can touch the file which causes it to be restarted, but the config must be changed for code in node_modules to be reloaded or the server will just reload whatever was in its cache.
6 replies
TTCTheo's Typesafe Cult
Created by Huperniketes on 5/13/2024 in #questions
t3 workflow?
On 3, I had to add an option to the config object in next.conf.js for logging statements to work:
const config = {
compiler: {
removeConsole: false,
},
}
const config = {
compiler: {
removeConsole: false,
},
}
6 replies
TTCTheo's Typesafe Cult
Created by Huperniketes on 5/13/2024 in #questions
t3 workflow?
Thanks for your reply. You've confirmed my understanding of how it should work, so I'll continue digging into the anomalies I see.
6 replies
TTCTheo's Typesafe Cult
Created by variable_name on 7/5/2023 in #questions
Clerk: Is it possible to create custom metadata on signup using Clerk?
4 replies
TTCTheo's Typesafe Cult
Created by variable_name on 7/5/2023 in #questions
Clerk: Is it possible to create custom metadata on signup using Clerk?
You can create a webhook API for Clerk to notify you when a user's been created.
4 replies
TTCTheo's Typesafe Cult
Created by Huperniketes on 7/5/2023 in #questions
how can I invoke a trpc call inside a nested function?
Thank you very much!
14 replies
TTCTheo's Typesafe Cult
Created by Huperniketes on 7/5/2023 in #questions
how can I invoke a trpc call inside a nested function?
Yeah, that did the trick. I just needed to do a little more data massaging of my stuff for everything to work.
14 replies
TTCTheo's Typesafe Cult
Created by Huperniketes on 7/5/2023 in #questions
how can I invoke a trpc call inside a nested function?
And react doesn't regard it as a hook?
14 replies
TTCTheo's Typesafe Cult
Created by Huperniketes on 7/5/2023 in #questions
how can I invoke a trpc call inside a nested function?
Don't they normally do that? eg, api.posts.getAll.useQuery() in theo's t3 tutorial?
14 replies
TTCTheo's Typesafe Cult
Created by four4255 on 6/29/2023 in #questions
NextJS app router trips/[id]/page.tsx
If you need to set up props with getServerSideProps(), you'd do something like
export async function
getServerSideProps(ctx: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>): Promise<{ props: {
id: string,
}}>
{
const id = ctx.query?.id || "";

return ({ props: { id }});
}
export async function
getServerSideProps(ctx: GetServerSidePropsContext<ParsedUrlQuery, PreviewData>): Promise<{ props: {
id: string,
}}>
{
const id = ctx.query?.id || "";

return ({ props: { id }});
}
4 replies
TTCTheo's Typesafe Cult
Created by z on 6/26/2023 in #questions
NextJS "Module not found" error with "loading.tsx"?
I found the source for the error I experienced: I imported the needed definition from the wrong file. When I used the correct file reference, the error went away and the build completed.
13 replies
TTCTheo's Typesafe Cult
Created by z on 6/26/2023 in #questions
NextJS "Module not found" error with "loading.tsx"?
That isn't the actual error, and I don't recall what the cause was when I got this error. What was the last change you made?
13 replies
TTCTheo's Typesafe Cult
Created by import_antigravity on 6/27/2023 in #questions
tanstack query (requests in bulk vs individual)
Wouldn't prefetchQuery() be more like what you're looking for?
10 replies
TTCTheo's Typesafe Cult
Created by Alefe Bispo - BRT on 6/9/2023 in #questions
Which content creator offers the best material to learn Nextjs?
They're fine for learning Next in a specific model: pages vs appdir, but their coverage on using trpc is lacking.
8 replies
TTCTheo's Typesafe Cult
Created by fero.xd on 5/31/2023 in #questions
Want to request only half of the audio file but not working
Start playback at the quarter file mark and play 10 seconds.
7 replies
TTCTheo's Typesafe Cult
Created by fero.xd on 5/31/2023 in #questions
Want to request only half of the audio file but not working
Then hard code the filename and half its duration for the playback. Make sure that works.
7 replies
TTCTheo's Typesafe Cult
Created by fero.xd on 5/31/2023 in #questions
Want to request only half of the audio file but not working
The server code has to parse and comply with the range spec.
7 replies
TTCTheo's Typesafe Cult
Created by Ethan on 5/11/2023 in #questions
Using GithubAPI + NextAuth Github Provider to access a User's repo information.
When you fixed the undefined issues, did you change the code you posted previously?
9 replies