I push on git my next project for update automatically on vercel but i got this error :
Unanswered
Polish Hound posted this in #help-forum
Polish HoundOP
21 Replies
Polish HoundOP
this is the expanded error :
@Polish Hound Click to see attachment
what nextjs version are you using? according to https://github.com/vercel/next.js/issues/46493 it should work with the latest version
Polish HoundOP
nextJS 13
as in the full version number. 13.x.y, what are x and y
Polish HoundOP
13.4.19
hmm then i need a [minimal reproduction repository](https://nextjs-faq.com/minimal-reproduction-repository) to debug this
Polish HoundOP
sorry but i read and i don't understand
basically, i need a simplified version of your current repository where the bug is reproduced, so i can clone and debug locally
Polish HoundOP
if this helps you I had no errors before creating this file:
and use it like this :
import prisma from "@/app/libs/prismadb";
import getCurrentUser from "./getCurrentUser";
const getAreFriends = async (
friendId: string
) => {
try {
const currentUser = await getCurrentUser();
if (!currentUser?.id) {
return [];
}
const user = await prisma.user.findUnique({
where: {
id: currentUser.id as string,
},
include: {
friends: {
where: {
id: friendId as string,
},
},
},
});
if (!user?.friends) {
return false
} else {
return true
}
} catch (error: any) {
return false;
}
}
export default getAreFriends;and use it like this :
const areFriends = getAreFriends(data.id);
if (!areFriends) {
// action
} else {
// action
}@joulev basically, i need a simplified version of your current repository where the bug is reproduced, so i can clone and debug locally
Polish HoundOP
so my repo is in github, i must send you the link ?
make a simplified version. my timetable doesn't allow me to debug a full-scale application
Polish HoundOP
ok i undersatnd
but how to simplify ?
but how to simplify ?
@Polish Hound if this helps you I had no errors before creating this file:
ts
import prisma from "@/app/libs/prismadb";
import getCurrentUser from "./getCurrentUser";
const getAreFriends = async (
friendId: string
) => {
try {
const currentUser = await getCurrentUser();
if (!currentUser?.id) {
return [];
}
const user = await prisma.user.findUnique({
where: {
id: currentUser.id as string,
},
include: {
friends: {
where: {
id: friendId as string,
},
},
},
});
if (!user?.friends) {
return false
} else {
return true
}
} catch (error: any) {
return false;
}
}
export default getAreFriends;
and use it like this :
tsx
const areFriends = getAreFriends(data.id);
if (!areFriends) {
// action
} else {
// action
}
Polish HoundOP
i read the 4 :
After each time you remove a chunk out of your code, try to reproduce the problem. At one point it will vanish. That's when you know where the bug is hiding at. Revert the change that makes the problem go away, now your repository should already be pretty minimal.
So i remove the file i remove the file and tere is no errors
After each time you remove a chunk out of your code, try to reproduce the problem. At one point it will vanish. That's when you know where the bug is hiding at. Revert the change that makes the problem go away, now your repository should already be pretty minimal.
So i remove the file i remove the file and tere is no errors
so the error com from this file
@joulev
i can't make a simplified repo sorry because i don't understand hox to make
but i found in wich file is the error
Then idk, sorry. I can’t open and debug locally and I don’t have any educated guesses here, so I can’t help
Polish HoundOP
ok thanks anyway