Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): better errors for engine not found #19330

Merged
merged 27 commits into from
May 25, 2023

Conversation

millsp
Copy link
Member

@millsp millsp commented May 18, 2023

This PR improves the current engine not found errors, which are not helpful for users, and not helpful for us to identify issues. Based on many issues related to engines not being found, we have come up with the following issue messages:

  1. When the client was generated with any native, if the actual platform at the time of generation and the platform obtained at runtime are not equal, append information to the error.
    • Example error message:

      This is likely caused because the Prisma Client was generated on platform <generation-time-platform>, but the actual deployment required <runtime-platform>. Add <runtime-platform> to binaryTargets in your schema.

  2. When the client was generated with pinned binaryTargets and without any native, and the actual platform obtained at runtime does not match any binaryTargets, append information to the error to explain that the targets were not pinned correctly.
    • Example error message:

      This is likely caused because you incorrectly pinned the binaryTargets. This Prisma Client was generated with binaryTargets being <binary-targets-array>, but the actual deployment required <runtime-platform>. Add <runtime-platform> to binaryTargets in your schema.

  3. When bundling is involved, append information to the error that explains why this happened and point users to submit some information to us.
    • Example error message:

      This is likely caused by a bundling step, which leads to the engine not being copied near the resulting bundle. We would appreciate if you could take the time to share some information with us.

  4. Any other error can only be explained by a missing engine, or an error case that we haven’t seen or learned about. We help the user as much as we can, and ask for information.
    • Example error message:

      This is likely caused because the engine was not copied to the deployed location. We expected the engine to be found at <__dirname>/<engine>. If you cannot resolve this, we would appreciate if you could take the time to share some information with us.

closes #7228
closes #16872
closes #15631
closes #15638
closes #17906
closes #17996
closes #7848
closes #15292
closes #13396
closes #13266

https://www.notion.so/prismaio/af44ea91e0904c0ab9f732145cac2d3f

@millsp millsp changed the title fix(client): better errors for engine not found (library) fix(client): better errors for engine not found May 18, 2023
@millsp millsp added this to the 4.15.0 milestone May 18, 2023
@prisma prisma deleted a comment from codspeed-hq bot May 18, 2023
@millsp millsp marked this pull request as ready for review May 19, 2023 02:22
@millsp millsp requested a review from a team May 19, 2023 02:22
@millsp millsp requested review from SevInf and aqrln and removed request for a team May 19, 2023 02:22
Copy link
Contributor

@SevInf SevInf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with small nit

…ath.ts

Co-authored-by: Sergey Tatarintsev <tatarintsev@prisma.io>
@millsp millsp merged commit bfc2193 into main May 25, 2023
73 checks passed
@millsp millsp deleted the integration/fix/client/unclear-engine-not-found-messages branch May 25, 2023 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment