MongoDB / Prisma ORM failing on deploy (working fine locally)

Site name: portfolio-test-011423.netlify.app/

I am unable to get my Remix app to load anything related to the DB when deployed. It works perfectly in both production and development environments locally, but when I deploy it gives me this strange “error message”, which I believe originates from Prisma:

{
  "clientVersion": "4.8.1"
}

What’s stranger, the “error” has status: 200.

Here’s my netlify.toml config:

[build]
  command = "CI= npm run build"
  publish = "public"

[dev]
  autoLaunch = false
  command = "remix watch"
  port = 3000

[[redirects]]
  from = "/*"
  to = "/.netlify/functions/server"
  status = 200

[[headers]]
  for = "/build/*"
  [headers.values]
    "Cache-Control" = "public, max-age=31536000, s-maxage=31536000"

I also created a version of my site using sqlite rather than mongo, and it works fine locally in development mode as well, but in production and in deployment it returns a different error in the prisma logs:

  The table `(not available)` does not exist in the current database.
  code: 'P2021', 
  clientVersion: '4.8.1', 

If anyone can help me solve this, I would be very appreciative. Been trying to deploy this thing for like 2 weeks!! :sweat_smile:

Well, this was not an issue with prisma or netlify. Dev error :joy:, I began my DATABASE_URL var with ongo rather than mongo in the site env vars on Netlify. Yeesh! :see_no_evil:

Hi @joshuagraber :wave:t6:,

Welcome to the forums and thanks so much for coming back and letting us know you were able to solve your problem! (: Appreciate the feedback.

1 Like