getbigger-io / prisma-fixtures

Prisma 2 Fixtures Management Tool
MIT License
25 stars 2 forks source link

[Bug] Fail fixture loading: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again #3

Open abulojoshua1 opened 2 years ago

abulojoshua1 commented 2 years ago

Your Environment

Incompatibility with Prisma v3+

Fail fixture loading: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues
    at new PrismaClient (/node_modules/@getbigger-io/prisma-fixtures-cli/node_modules/.prisma/client/index.js:3:11)
    at Object.<anonymous> (/node_modules/@getbigger-io/prisma-fixtures-cli/dist/util/createConnection.js:16:24)
    at Generator.next (<anonymous>)
    at /node_modules/@getbigger-io/prisma-fixtures-cli/dist/util/createConnection.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/node_modules/@getbigger-io/prisma-fixtures-cli/dist/util/createConnection.js:4:12)
    at Object.createConnection (/node_modules/@getbigger-io/prisma-fixtures-cli/dist/util/createConnection.js:15:12)
    at Object.<anonymous> (/node_modules/@getbigger-io/prisma-fixtures-cli/dist/cli.js:58:8)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
lamaland commented 2 years ago

Running prisma 3.3.0 right now, no issue on my side. You should check your code (that you correctly generated your client before loading fixtures, that's what the message says anyway)

earthpyy commented 2 years ago

I'm having the same problem. Running on Prisma 4.1.x

nmacherey commented 2 years ago

@earthpyy the next release will be compatible with prisma 4. You can try the last commit on the master branch

earthpyy commented 2 years ago

@nmacherey Glad to hear that! Looking forward for the release 😄

nikechanhk commented 1 year ago

@earthpyy the next release will be compatible with prisma 4. You can try the last commit on the master branch

This project should deserve more star

mehdibo commented 1 year ago

I did this and the issue was solved:

rm -rf node_modules/@getbigger-io/prisma-fixtures-cli/node_modules/.prisma
yarn prisma generate