Need help, error while building the Next.js app
Unanswered
Reddish carpenter ant posted this in #help-forum
Reddish carpenter antOP
Hey!! 👋 Need someone to help me to debug my code. I finished a nextjs project using prisma and graphql. but when I run the "npm run build" command I get an error that I've been experiencing for several days. I looked through forums and such but couldn't find anything. I need someone to help me. Thanks
24 Replies
@Reddish carpenter ant Hey!! 👋 Need someone to help me to debug my code. I finished a nextjs project using prisma and graphql. but when I run the "npm run build" command I get an error that I've been experiencing for several days. I looked through forums and such but couldn't find anything. I need someone to help me. Thanks
Dunker
I would like to look at it, but I need terminal logs
Probably you are getting same error at editor, first find that line
Reddish carpenter antOP
This is working in local, but now that I run “non run build†for deploying, I get this error
npm run build*
Dunker
Where are you deploying this
Reddish carpenter antOP
On Vercel
Dunker
So you are saying my local build is working
Reddish carpenter antOP
No local build is not working
Dunker
Yep, cuz you have a type error
Reddish carpenter antOP
The app is working in local “npm run devâ€. But when I run the command “npm run build†I got this error
Dunker
Are you using typescript
Reddish carpenter antOP
Yes
Dunker
Can you find that file which shows error
Reddish carpenter antOP
Yes
Dunker
Okay find that file and paste full error here
And file
Maybe a ss with error is better
Reddish carpenter antOP
next build
Linting and checking validity of types ..Failed to compile.
./graphql/types/Filiere.ts:51:13
Type error: Type '(query: { include?: FiliereInclude<DefaultArgs> | undefined; select?: FiliereSelect<Defau
ltArgs> | undefined; }, _parent: {}, args: InputShapeFromFields<...>, ctx: Promise<...>) => Promise<...>' is not assignable to type 'PrismaFieldResolver<ExtendDefaultTypes<{ Context: Promise<{ user?: undefined; exp
ires?: undefined; } | { user: { role: string | null | undefined; } & { name?: string | null | undefined; em
ail?: string | null | undefined; image?: string | null | undefined; }; expires: string; } | undefined>; Pri
smaTypes: PrismaTypes;...'.
Type 'Promise<unknown>' is not assignable to type 'MaybePromise<GetResult<{ id: string; name: string; des
cription: string; createdAt: Date; updatedAt: Date; }, unknown, never> & {}>'.
Type 'Promise<unknown>' is not assignable to type 'Promise<GetResult<{ id: string; name: string; descri
ption: string; createdAt: Date; updatedAt: Date; }, unknown, never> & {}>'.
Type 'unknown' is not assignable to type 'GetResult<{ id: string; name: string; description: string;
createdAt: Date; updatedAt: Date; }, unknown, never> & {}'.
Type 'unknown' is not assignable to type 'GetResult<{ id: string; name: string; description: string
; createdAt: Date; updatedAt: Date; }, unknown, never>'.
49 | description: t.arg.string({ required: true }),
50 | },
51 | resolve: async (query, _parent, args, ctx) => {| ^
52 |
53 | const { name, description, } = args
54 |
Linting and checking validity of types ...
Dunker
do you know live share ext on vscode @Reddish carpenter ant
Reddish carpenter antOP
No @Dunker
Reddish carpenter antOP
Can we have a meet ? @Dunker
@Reddish carpenter ant Can we have a meet ? <@1017915332305879061>
Dunker
live share is best actually
i can see your editor and edit it
just install it and send me a link