ncls.
ncls.
Explore posts from servers
NNuxt
Created by souf on 9/27/2024 in #❓・help
NuxtLoadingIndicator
Can you provide a repro example via Stackblitz or something?
5 replies
NNuxt
Created by ncls. on 9/25/2024 in #❓・help
React to route change in layout
So basically I was just an idiot... I made a sidenav that used the route parameters and I defined an array for the different links where I inserted these params but I didn't make that array a computed...
11 replies
NNuxt
Created by ncls. on 9/25/2024 in #❓・help
React to route change in layout
Let me try real quick
11 replies
NNuxt
Created by ncls. on 9/25/2024 in #❓・help
React to route change in layout
Hi, thanks for your help. However, I forgot to change the code in the question but I actually found out that the issue is just the params which I need. You can see the issue in my reproduction example above.
11 replies
NNuxt
Created by ncls. on 9/25/2024 in #❓・help
React to route change in layout
I just found out that that's only when I use the code in the setup of the layout. Here's a reproduction example: https://stackblitz.com/edit/nuxt-starter-bnnw74?file=layouts%2Fdefault.vue,pages%2F[...slug].vue
11 replies
NNuxt
Created by souf on 9/27/2024 in #❓・help
NuxtLoadingIndicator
5 replies
NNuxt
Created by ncls. on 9/25/2024 in #❓・help
React to route change in layout
bump again
11 replies
NNuxt
Created by ncls. on 9/25/2024 in #❓・help
React to route change in layout
bump
11 replies
NNuxt
Created by Zack Plauché on 8/23/2024 in #❓・help
Might be a Tailwind question, but... somehow my Google Fonts are working without adding any <link>s
Which font is it? Do you have it installed locally?
2 replies
PPrisma
Created by ncls. on 7/12/2024 in #help-and-questions
How to reference/store a joined primary key?
Will do. Thanks again for the hint. Idk how I missed that all the time...😅
10 replies
PPrisma
Created by ncls. on 7/12/2024 in #help-and-questions
How to reference/store a joined primary key?
Generating a new key doesn't work for my case since the values come from CSV files and should be updated if they already exist (using upsert)
10 replies
PPrisma
Created by ncls. on 7/12/2024 in #help-and-questions
How to reference/store a joined primary key?
I was on this page like 200 times and somehow always managed to miss that...😭 I will try and see if it works tomorrow. Thank you!
10 replies
PPrisma
Created by ncls. on 7/12/2024 in #help-and-questions
How to reference/store a joined primary key?
Bump
10 replies
PPrisma
Created by ncls. on 7/12/2024 in #help-and-questions
How to reference/store a joined primary key?
Bump
10 replies
PPrisma
Created by ncls. on 7/12/2024 in #help-and-questions
How to reference/store a joined primary key?
Bump
10 replies
PPrisma
Created by nikitarevenco on 7/12/2024 in #help-and-questions
Get type of prisma client before it is defined
You can create a type which has all the additional typing and then do
type PrismaClientWithExtension = PrismaClient & {
// All your additional attributes...
}

declare global {
var prisma: PrismaClientWithExtension | undefined;
}
type PrismaClientWithExtension = PrismaClient & {
// All your additional attributes...
}

declare global {
var prisma: PrismaClientWithExtension | undefined;
}
12 replies
PPrisma
Created by nikitarevenco on 7/12/2024 in #help-and-questions
Get type of prisma client before it is defined
Then try my code. I don't know why it would be unsafe to use it.
12 replies
PPrisma
Created by nikitarevenco on 7/12/2024 in #help-and-questions
Get type of prisma client before it is defined
Are you trying to run prisma in the middleware? That doesn't work since the middlware is run on the edge runtime which Prisma can't do
12 replies
PPrisma
Created by nikitarevenco on 7/12/2024 in #help-and-questions
Get type of prisma client before it is defined
I use the following solution in a file called prisma.ts where I then import my client from:
import { PrismaClient } from '@prisma/client';

declare global {
var prisma: PrismaClient | undefined;
}

const prisma = globalThis.prisma || new PrismaClient();

if (process.env.NODE_ENV !== 'production') globalThis.prisma = prisma;

export default prisma;
import { PrismaClient } from '@prisma/client';

declare global {
var prisma: PrismaClient | undefined;
}

const prisma = globalThis.prisma || new PrismaClient();

if (process.env.NODE_ENV !== 'production') globalThis.prisma = prisma;

export default prisma;
12 replies
DIAdiscord.js - Imagine an app
Created by bavtrungdai on 8/21/2023 in #djs-questions
giveaway bot
<Embed>.fields.find() returns a field object while <Array>.slice() expects an index as the first parameter. You should get an error there.
6 replies