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

Topic summary

Deployment of a Shopify Remix app to Vercel fails with “Prisma session table does not exist,” indicating the database schema/tables for session storage aren’t present or accessible.

Attempts reported:

  • Followed Prisma/Vercel caching and Shopify template troubleshooting guides; added prisma generate to build/start; migrated and pushed DB; switched DB providers. The error persists for multiple users.

Suggested fixes:

  • Ensure Prisma client generation runs automatically: set “postinstall”: “prisma generate” in package.json. This helps Vercel builds produce the client.
  • If using Vercel Postgres and seeing connection pool timeouts (P2024), increase the connection_limit by updating POSTGRES_PRISMA_URL via the Vercel CLI, per Vercel docs.
  • Confirm database is actually migrated. In schema.prisma, set provider = “postgresql” and use env vars POSTGRES_PRISMA_URL (pooled) and POSTGRES_URL_NON_POOLING (direct). Pull correct envs with “vercel env pull”, delete local migrations if needed, then run: npx prisma migrate dev --name app-setup.

Status: No confirmed resolution from the original reporters yet. Guidance centers on ensuring proper env vars, Prisma client generation, and running a clean migration to create the session tables.

Summarized with AI on December 25. AI used: gpt-5.

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

1 Like

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.

Any luck with this one? I’m facing the same problem…

  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

@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 **

1 Like