Hey all! Anyone willing to give some guidance on s...
# orm-help
c
Hey all! Anyone willing to give some guidance on seeing where I'm going wrong on the Vercel deployment guide. I've feel like I've followed it to a t several times through using Heroku as my PostgreSQL db, I get all the right feedback from the checkpoint tests, but consistently getting
502
errors when I try to seed the data or fetch it using the client, here's my final URL https://prisma-vercel-test10.coopermor.vercel.app/
d
Can you share the logs from Vercel?
c
Yea so I'm seeing this during build
Copy code
Retrieving list of deployment files...
21:05:58.015  
Downloading 12 deployment files...
21:05:59.925  
Installing build runtime...
21:06:00.389  
Build runtime installed: 463.700ms
21:06:00.857  
Looking up build cache...
21:06:00.893  
Build cache not found
21:06:01.261  
Installing build runtime...
21:06:01.373  
Installing dependencies...
21:06:01.842  
Build runtime installed: 581.275ms
21:06:02.366  
Looking up build cache...
21:06:02.403  
Build cache not found
21:06:02.824  
Installing build runtime...
21:06:02.978  
Installing dependencies...
21:06:03.160  
> @prisma/cli@2.0.1 preinstall /vercel/3c3117b/node_modules/@prisma/cli
21:06:03.160  
> node preinstall/index.js
21:06:03.225  
> vercel@19.0.1 preinstall /vercel/3c3117b/node_modules/vercel
21:06:03.225  
> node ./scripts/preinstall.js
21:06:03.286  
> @prisma/cli@2.0.1 install /vercel/3c3117b/node_modules/@prisma/cli
21:06:03.286  
> node download-build/index.js
21:06:03.426  
Build runtime installed: 602.060ms
21:06:04.052  
Looking up build cache...
21:06:04.092  
Build cache not found
21:06:04.546  
Installing build runtime...
21:06:04.652  
> @prisma/client@2.0.1 postinstall /vercel/3c3117b/node_modules/@prisma/client
21:06:04.652  
> node scripts/postinstall.js
21:06:04.751  
Installing dependencies...
21:06:05.150  
Build runtime installed: 604.545ms
21:06:05.752  
Error: Either provide --schema or make sure that you are in a folder with a schema.prisma file.
21:06:05.766  
> prisma-vercel@ postinstall /vercel/3c3117b
21:06:05.766  
> prisma generate
21:06:05.854  
Looking up build cache...
21:06:05.897  
Build cache not found
21:06:06.059  
Installing build runtime...
21:06:06.575  
Installing dependencies...
21:06:06.687  
Build runtime installed: 628.508ms
21:06:07.227  
Looking up build cache...
21:06:07.284  
Build cache not found
21:06:07.738  
✔ Generated Prisma Client to ./node_modules/@prisma/client in 63ms
21:06:07.738  
You can now start using Prisma Client in your code:
21:06:07.738
210607.738 import { PrismaClient } from '@prisma/client' 210607.738 // or const { PrismaClient } = require('@prisma/client') 210607.738 const prisma = new PrismaClient() 210607.738
Copy code
21:06:07.738  
Explore the full API: <http://pris.ly/d/client>
21:06:07.760  
npm WARN prisma-vercel@ No repository field.
21:06:07.760  
npm WARN prisma-vercel@ No license field.
21:06:07.761  
added 10 packages from 2 contributors in 5.902s
21:06:07.770  
1 package is looking for funding
21:06:07.770  
  run `npm fund` for details
21:06:07.897  
Installing dependencies...
21:06:08.932  
> @prisma/cli@2.0.1 preinstall /vercel/f64566a/node_modules/@prisma/cli
21:06:08.932  
> node preinstall/index.js
21:06:08.999  
> vercel@19.0.1 preinstall /vercel/f64566a/node_modules/vercel
21:06:08.999  
> node ./scripts/preinstall.js
21:06:09.072  
> @prisma/cli@2.0.1 install /vercel/f64566a/node_modules/@prisma/cli
21:06:09.072  
> node download-build/index.js
21:06:09.639  
> @prisma/client@2.0.1 postinstall /vercel/f64566a/node_modules/@prisma/client
21:06:09.639  
> node scripts/postinstall.js
21:06:10.164  
Uploading build outputs...
21:06:10.577  
Error: Either provide --schema or make sure that you are in a folder with a schema.prisma file.
21:06:10.593  
> prisma-vercel@ postinstall /vercel/f64566a
21:06:10.594  
> prisma generate
21:06:12.050  
✔ Generated Prisma Client to ./node_modules/@prisma/client in 57ms
21:06:12.050  
You can now start using Prisma Client in your code:
21:06:12.051
210612.051 import { PrismaClient } from '@prisma/client' 210612.051 // or const { PrismaClient } = require('@prisma/client') 210612.051 const prisma = new PrismaClient() 210612.051
Copy code
21:06:12.051  
Explore the full API: <http://pris.ly/d/client>
21:06:12.071  
npm WARN prisma-vercel@ No repository field.
21:06:12.071  
npm WARN prisma-vercel@ No license field.
21:06:12.072  
added 10 packages from 2 contributors in 3.837s
21:06:12.078  
1 package is looking for funding
21:06:12.078  
  run `npm fund` for details
21:06:13.150  
> @prisma/cli@2.0.1 preinstall /vercel/4a9db28b/node_modules/@prisma/cli
21:06:13.150  
> node preinstall/index.js
21:06:13.226  
> vercel@19.0.1 preinstall /vercel/4a9db28b/node_modules/vercel
21:06:13.226  
> node ./scripts/preinstall.js
21:06:13.290  
> @prisma/cli@2.0.1 install /vercel/4a9db28b/node_modules/@prisma/cli
21:06:13.290  
> node download-build/index.js
21:06:13.847  
> @prisma/client@2.0.1 postinstall /vercel/4a9db28b/node_modules/@prisma/client
21:06:13.847  
> node scripts/postinstall.js
21:06:14.416  
Uploading build outputs...
21:06:14.789  
Error: Either provide --schema or make sure that you are in a folder with a schema.prisma file.
21:06:14.801  
> prisma-vercel@ postinstall /vercel/4a9db28b
21:06:14.801  
> prisma generate
21:06:15.987  
Done with "api/getPosts.js"
21:06:16.279  
✔ Generated Prisma Client to ./node_modules/@prisma/client in 60ms
21:06:16.279  
You can now start using Prisma Client in your code:
21:06:16.279
210616.279 import { PrismaClient } from '@prisma/client' 210616.279 // or const { PrismaClient } = require('@prisma/client') 210616.279 const prisma = new PrismaClient() 210616.279
Copy code
21:06:16.279  
Explore the full API: <http://pris.ly/d/client>
21:06:16.302  
npm WARN prisma-vercel@ No repository field.
21:06:16.302  
npm WARN prisma-vercel@ No license field.
21:06:16.303  
added 10 packages from 2 contributors in 3.798s
21:06:16.313  
1 package is looking for funding
21:06:16.313  
  run `npm fund` for details
21:06:16.672  
Uploading build outputs...
21:06:17.224  
> @prisma/cli@2.0.1 preinstall /vercel/247a88c2/node_modules/@prisma/cli
21:06:17.225  
> node preinstall/index.js
21:06:17.281  
> vercel@19.0.1 preinstall /vercel/247a88c2/node_modules/vercel
21:06:17.281  
> node ./scripts/preinstall.js
21:06:17.332  
> @prisma/cli@2.0.1 install /vercel/247a88c2/node_modules/@prisma/cli
21:06:17.332  
> node download-build/index.js
21:06:17.833  
> @prisma/client@2.0.1 postinstall /vercel/247a88c2/node_modules/@prisma/client
21:06:17.833  
> node scripts/postinstall.js
21:06:18.507  
Done with "api/index.js"
21:06:18.686  
Error: Either provide --schema or make sure that you are in a folder with a schema.prisma file.
21:06:18.699  
> prisma-vercel@ postinstall /vercel/247a88c2
21:06:18.699  
> prisma generate
21:06:20.159  
✔ Generated Prisma Client to ./node_modules/@prisma/client in 58ms
21:06:20.160  
You can now start using Prisma Client in your code:
21:06:20.160
210620.160 import { PrismaClient } from '@prisma/client' 210620.160 // or const { PrismaClient } = require('@prisma/client') 210620.160 const prisma = new PrismaClient() 210620.160
Copy code
21:06:20.160  
Explore the full API: <http://pris.ly/d/client>
21:06:20.200  
npm WARN prisma-vercel@ No repository field.
21:06:20.200  
npm WARN prisma-vercel@ No license field.
21:06:20.201  
added 10 packages from 2 contributors in 3.526s
21:06:20.208  
1 package is looking for funding
21:06:20.208  
  run `npm fund` for details
21:06:21.354  
> @prisma/cli@2.0.1 preinstall /vercel/4604cc51/node_modules/@prisma/cli
21:06:21.354  
> node preinstall/index.js
21:06:21.421  
> vercel@19.0.1 preinstall /vercel/4604cc51/node_modules/vercel
21:06:21.421  
> node ./scripts/preinstall.js
21:06:21.490  
> @prisma/cli@2.0.1 install /vercel/4604cc51/node_modules/@prisma/cli
21:06:21.490  
> node download-build/index.js
21:06:22.060  
> @prisma/client@2.0.1 postinstall /vercel/4604cc51/node_modules/@prisma/client
21:06:22.060  
> node scripts/postinstall.js
21:06:22.532  
Uploading build outputs...
21:06:22.995  
Error: Either provide --schema or make sure that you are in a folder with a schema.prisma file.
21:06:23.008  
> prisma-vercel@ postinstall /vercel/4604cc51
21:06:23.008  
> prisma generate
21:06:24.301  
Done with "api/seed.js"
21:06:24.458  
✔ Generated Prisma Client to ./node_modules/@prisma/client in 59ms
21:06:24.458  
You can now start using Prisma Client in your code:
21:06:24.458
210624.458 import { PrismaClient } from '@prisma/client' 210624.458 // or const { PrismaClient } = require('@prisma/client') 210624.458 const prisma = new PrismaClient() 210624.458
Copy code
21:06:24.458  
Explore the full API: <http://pris.ly/d/client>
21:06:24.481  
npm WARN prisma-vercel@ No repository field.
21:06:24.481  
npm WARN prisma-vercel@ No license field.
21:06:24.482  
added 10 packages from 2 contributors in 3.801s
21:06:24.490  
1 package is looking for funding
21:06:24.490  
  run `npm fund` for details
21:06:26.493  
Uploading build outputs...
21:06:28.183  
Done with "api/createUser.js"
21:06:29.132  
Build completed. Populating build cache...
21:06:31.556  
Uploading build cache [41.00 MB]...
21:06:32.314  
Build cache uploaded: 763.386ms
21:06:32.326  
Done with "api/getUsers.js"
And when I execute a function I see :
Copy code
[GET] /api/seed
06:59:32:81
2020-06-23T10:59:34.952Z	beab4f01-258e-4f37-9d13-a5daf35d3885	ERROR	PrismaClientValidationError: Unknown arg `profile` in data.profile for type UserCreateInput. Did you mean `Profile`?
Unknown arg `post` in <http://data.post|data.post> for type UserCreateInput. Did you mean `Post`?
    at Document.validate (/var/task/node_modules/@prisma/client/runtime/index.js:1:33036)
    at Object.s [as User] (/var/task/node_modules/@prisma/client/runtime/index.js:1:145947)
    at Object.create (/var/task/node_modules/@prisma/client/runtime/index.js:1:147290)
    at _default (/var/task/api/seed.js:9:43)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Server.<anonymous> (/var/task/___now_helpers.js:873:13)
2020-06-23T10:59:42.867Z beab4f01-258e-4f37-9d13-a5daf35d3885 Task timed out after 10.01 seconds
👀 1
d
@Cooper Mor Thanks for sharing the error. I tested the example and guide and indeed there was a bug. That has been fixed both in the deployment guide and the example. I suggest you take a look again. This is the step that was missing: https://www.prisma.io/docs/guides/deployment/deploying-to-vercel#rename-the-relation-fields-for-easy-access
c
Thanks Daniel! Will give it a try, I also had a similar outcome following the Netlify tutorial
👍 1
@Daniel Norman found one little bug in the
seed.js
file where it's
profile: {
instead of
profiles: {
once I changed that, all working smoothly!
👍 1
d
Fixed!
💯 1
Thanks for pointing it out
c
Awesome! Happy I could help
👌 1