Hi everyone. I'm having some trouble with the pri...
# orm-help
s
Hi everyone. I'm having some trouble with the prisma client (I think) deploying to netlify with nextjs (with a supabase db). I'm able to write to the db but my queries are failings. Help understanding the debugging tools here would also be helpful. Where is the best place to get some help?
r
@Saul Nachman 👋 Are you getting any error message when it fails? Try adding a
try/catch
and see if the error is logged in
catch
.
Have a look at these links as well if it helps 🙂 http://pris.ly/d/debugging http://pris.ly/d/logging
s
Also got a "failed to fetch schema error" at one stage, though can't seem to get it again where I can see it.
Thanks for the links.
I'll get to console logging once I understand better where the error is.
r
Is introspection enabled on the GraphQL server?
s
I don't know. New to the stack. How would I check?
r
How did you initialise the GraphQL server in your code?
s
Copy code
import { ApolloServer } from "apollo-server-micro";
r
After the conxtext, you should get an option of
introspection
. Set that to
true
and then deploy again to check.
s
ok lemme see
Not seeing it in type defs. Lemme check the docs
tracing and debug may be useful tho
intellisense completes introspection so lets use it
I'll say when it's built
No changes that I can see. Just getting a 502 in console now
Copy code
8:45:48 AM: 2021-09-03T06:45:48.303Z	undefined	INFO	Loaded env from .env
8:45:48 AM: 2021-09-03T06:45:48.700Z prisma:tryLoadEnv Environment variables not found at /var/task/.env
8:45:48 AM: 2021-09-03T06:45:48.701Z prisma:tryLoadEnv Environment variables not found at /var/task/.env
8:45:48 AM: 2021-09-03T06:45:48.701Z prisma:tryLoadEnv No Environment variables loaded
8:45:48 AM: 2021-09-03T06:45:48.702Z prisma:tryLoadEnv Environment variables not found at /var/task/.env
8:45:48 AM: 2021-09-03T06:45:48.702Z prisma:tryLoadEnv Environment variables not found at /var/task/.env
8:45:48 AM: 2021-09-03T06:45:48.702Z prisma:tryLoadEnv No Environment variables loaded
8:45:48 AM: 2021-09-03T06:45:48.704Z prisma:client clientVersion: 2.20.1
8:45:49 AM: 2021-09-03T06:45:48.837Z	undefined	WARN	Warning: nexus-plugin-prisma@0.35.0 does not support @prisma/client@2.20.1. The supported range is: `2.23.x`. This could lead to undefined behaviors and bugs.
8:45:49 AM: 2021-09-03T06:45:49.260Z	undefined	ERROR	(node:8) [DEP0131] DeprecationWarning: The legacy HTTP parser is deprecated.
8:45:49 AM: 7d826eb5 INFO   [request] /api
8:45:49 AM: 7d826eb5 Duration: 61.10 ms	Memory Usage: 126 MB	Init Duration: 1186.53 ms	8:46:32 AM: 2021-09-03T06:46:32.688Z prisma:engine Search for Query Engine in /var/task/node_modules/.prisma/client
Function logs. Might have something to do with it.
r
There should be more to the function logs.
s
Just stuff like this repeated over and over:
Copy code
8:55:50 AM: 90dd2a62 INFO   [request] /api
8:55:50 AM: 90dd2a62 Duration: 5.43 ms	Memory Usage: 131 MB
What were you expecting from server introspection?
r
There should be some error related to either Prisma or GraphQL so that would make it easier to see what the issue is.
Does everything work fine locally?
s
Yeah
I suspect there's something being lost from files or env vars in the move to functions
r
We have an example test here for Netlify with Prisma. Could you compare that with your setup and check?
s
Sure will do. This is being mediated by the next deploy, so that might be in the way
💯 1
Fwiw. Just trying to get logs atm
Copy code
10:23:16 AM: 2021-09-03T08:23:16.472Z prisma:getGenerators {
10:23:16 AM:   neededVersions: [Object: null prototype] {
10:23:16 AM:     '60ba6551f29b17d7d6ce479e5733c70d9c00860e': { engines: [Array], binaryTargets: [] }
10:23:16 AM:   }
10:23:16 AM: }
10:23:16 AM: 2021-09-03T08:23:16.510Z prisma:getGenerators {
10:23:16 AM:   generatorBinaryPaths: {
10:23:16 AM:     queryEngine: {
10:23:16 AM:       'debian-openssl-1.1.x': '/opt/build/repo/node_modules/prisma/query-engine-debian-openssl-1.1.x',
10:23:16 AM:       'rhel-openssl-1.0.x': '/opt/build/repo/node_modules/prisma/query-engine-rhel-openssl-1.0.x'
10:23:16 AM:     }
10:23:16 AM:   }
10:23:16 AM: }
Getting this output on build logs
It turned out to have been an issue with the netlify process. I have it running fine on vercel
🤔 1
r
Ohh, that’s strange. No luck with logs, as in no error message regarding the 502?
s
couldn't get to the bottom of it
same deployment on vercel
pretty sure it was re the apollo server
r
Seems like it.