Deploy Shopify Remix app to Vercel error - Prisma session table does not exist.

Deploy Shopify Remix app to Vercel error - Prisma session table does not exist.

andyjpg
Shopify Partner
7 0 1

Hi,


I have created a Shopify app using Shopify-remix-template and was trying to deploy it onto Vercel.

The app failed to run with the following errors

 

Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Prisma session table does not exist. This could happen for a few reasons, see https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-app-session-storage-prisma#troubleshooting for more information","reason":{"errorType":"Error","errorMessage":"Prisma session table does not exist. This could happen for a few reasons, see https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-app-session-storage-prisma#troubleshooting for more information","stack":["Error: Prisma session table does not exist. This could happen for a few reasons, see https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-app-session-storage-prisma#troubleshooting for more information","    at /var/task/node_modules/@shopify/shopify-app-session-storage-prisma/build/cjs/prisma.js:23:13"]},"promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: Prisma session table does not exist. This could happen for a few reasons, see https://github.com/Shopify/shopify-app-js/tree/main/packages/shopify-app-session-storage-prisma#troubleshooting for more information","    at process.<anonymous> (file:///var/runtime/index.mjs:1276:17)","    at process.emit (node:events:530:35)","    at emit (node:internal/process/promises:150:20)","    at processPromiseRejections (node:internal/process/promises:284:27)","    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)"]}
Unknown application error occurred

 

 

I found few suggestions on fixing this issue below but not working

https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/vercel-caching-issue

https://github.com/Shopify/shopify-app-template-remix#database-tables-dont-exist

 

I have also tried to run npm setup or prisma generate before and after build script also tried to run it before start script, which are all not working.

 

Please help, thank you

Replies 4 (4)

joshcorbett
Shopify Partner
26 1 7

Am seeing this error also.

I've referenced the above articles, migrated and pushed my db, switched db providers, added prisma generation to my build command, etc.

you can't just say perchance

pedromsalbur
Shopify Partner
1 0 0

Any luck with this one? I'm facing the same problem...

fstovarr
Visitor
1 0 0

1. Make sure you set "postinstall": "prisma generate" in the package.json file.

2. If you are using Vercel Postgres and you get Timed out fetching a new connection from the connection pool message, make sure you read this section of the vercel docs. I had to update the POSTGRES_PRISMA_URL env var through the CLI to increase the connection_limit arg

Leysam
Shopify Partner
141 16 50

@andyjpg It's most likely you haven't migrated your db yet.

 

Make sure you set your schema.prisma correctly and pull the correct env from Vercel using vercel env pull

// your schema.prisma should start as

generator client {
  provider = "prisma-client-js"
}


datasource db {
  provider = "postgresql"
  url = env("POSTGRES_PRISMA_URL") // uses connection pooling
  directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
}

 
Delete any files inside migrations folder, then run:

npx prisma migrate dev --name app-setup


CC: @joshcorbett  @pedromsalbur 

Leysam | The Shopify Guy  

 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - Email me at [email protected]
- Check our work and services at grindot.studio