# Fix 'prisma/client did not initialize yet' on Vercel

> Fix the @prisma/client did not initialize yet error when deploying to Vercel by adding a postinstall script that runs prisma generate in your package.json.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2021-07-01 | Topics: [Database](https://flaviocopes.com/tags/database/) | Canonical: https://flaviocopes.com/prisma-fix-initialize-yet-vercel/

I built an app with [Next.js](https://flaviocopes.com/nextjs/) and [Prisma](https://flaviocopes.com/prisma/), and when I tried to deploy it on Vercel I got this deployment error:

![Vercel deployment error screen showing @prisma/client did not initialize yet error with stack trace](https://flaviocopes.com/images/prisma-fix-initialize-yet-vercel/Screen_Shot_2021-06-09_at_15.34.02.png)

```
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
```

The database was already initialized from my local dev install, and I just had to use it.

What did I do to solve?

I installed `prisma` as a dev dependency:

```
npm i -D prisma
```

and I added 

```
"postinstall": "prisma generate"
```

to the scripts in `package.json`:

```json
{
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "postinstall": "prisma generate"
  },
  "dependencies": {
    //...
  },
  "devDependencies": {
    //...
    "prisma": "^2.24.1",

  }
}
```

That solved the problem.
