question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate from `postinstall` hook is not working

See original GitHub issue

Bug description

Implicit generate from postinstall hook is not working.

We figured this out because the CSB E2E test didn’t have an explicit generate and that E2E test was failing with

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

CSB test was fixed via https://github.com/prisma/e2e-tests/pull/848

How to reproduce

  1. Setup a Prisma project with schema.prisma
  2. yarn/npm install Prisma client
  3. See logs for postinstall hook execution, the logs are dynamic and get removed by yarn, so you have to see it when it is happening
  4. Write a script that uses the client (without manually running generate) and import client etc. It should not have been generated yet.

Expected behavior

Implicit generate should work.

Prisma information

2.9.0-dev.71

We understand that this broke in 2.9.0-dev.69 https://github.com/prisma/prisma/pull/3886 (not confirmed)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Jolg42commented, Feb 2, 2021

@divyenduz can this be closed maybe?

1reaction
NMinhNguyencommented, Jan 22, 2021

@NMinhNguyen Do you yarn install anything after running prisma generate?

No, I’m not, I’m running yarn first. But don’t worry, I think my issue is different to this anyway.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate from postinstall hook is not working #5084 - GitHub
Write a script that uses the client (without manually running generate) and import client etc. It should not have been generated yet. Expected ......
Read more >
Bowerrc post install hook not working - Stack Overflow
The simple reason is because you don't have any packages in your bower.json or all of the packages have been installed. Please have...
Read more >
Lifecycle Scripts | Yarn - Package Manager
An overview of Yarn's supported lifecycle scripts.
Read more >
Build lifecycle hooks - Expo Documentation
Learn how to use the EAS Build lifecycle hooks with npm to customize your build process.
Read more >
Chart Hooks - KodeKloud
This simply defines a post-install hook that would create a Kubernetes Job to do something in our cluster after the helm install command ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found