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

prisma-query-engine is at the root of my project but it keeps saying it is not ready #322

Closed
ghost opened this issue Jan 14, 2024 · 5 comments

Comments

@ghost
Copy link

ghost commented Jan 14, 2024

Unhandled exception:
Exception: Prisma binary query engine not ready
#0 BinaryEngine._serverEndpoint. (package:orm/engines/binary.dart:97:13)
#1 RetryOptions.retry (package:retry/retry.dart:131:24)

#2 BinaryEngine._serverReady (package:orm/engines/binary.dart:104:18)

#3 BinaryEngine._internalStart (package:orm/engines/binary.dart:82:19)

#4 BinaryEngine.start (package:orm/engines/binary.dart:47:18)

#5 BinaryEngine.request (package:orm/engines/binary.dart:154:5)

#6 ActionClient.unserialized. (package:orm/src/runtime/action_client.dart:17:34)

#7 UserDelegate.findMany. (file:///D:/test/prisma/prisma/dart/client.dart:177:16)

@medz
Copy link
Owner

medz commented Jan 15, 2024

@kidusdev Can you provide specific information? For example, version number, dart sdk version, system type, etc.

@ghost
Copy link
Author

ghost commented Jan 15, 2024

@medz Thanks for your response, i figured out the issue. it was because i started my sqlite DATABASE_URL from the PrismaClient() declaration file instead of starting from the root project.

@RGusse
Copy link

RGusse commented Jan 17, 2024

I'm having this same problem with the engine:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: No query engine binary found (prisma-query-engine) in [/, /prisma, /.dart_tool]

This error occurs when I try to execute a query, example findMany.

ORM: 3.4.6 and 4.0.0-beta
Dart SDK version: 3.3.0-215.0.dev
SO: Windows 11 x64

@medz
Copy link
Owner

medz commented Jan 17, 2024

@RGusse I want to confirm your running process:

  1. Develop on WIndows and run npx prisma generate to generate Dart Prisma client code.
  2. Submit the generated Client code to the repo
  3. Run dart compile exe in dockerfile or Linux Server for AOT compilation
  4. run the compiled exe?

Second possibility: Are you running the ORM in a Flutter App?

NOTE: Prisma Client Dart does not currently support Flutter, I'm waiting for Prisma's C ABI engine.

If it's the first possibility, you may need to fix it as follows:

  1. You should not submit the code generated by npx prisma generate to the repo, please remove it (it will leak necessary information about your system, including database connection address and password)
  2. Use npx prisma generate to generate the client on the platform you will eventually run on.
  3. You will find that after the generation is completed, there will be an additional prisma-query-engine file in your project directory. Please place it in the same location as the dart compile exe output file.

The above is the method for 4.0.0-beta version. For 3.x version, prisma-query-engine is located in the Client code output directory (usually in lib/src/generated/prisma_client).

But I see that your error message is Flutter: ERROR. I guess you used it in the Flutter project. Currently, using package:orm in Flutter only supports Windows, macOS, Linux platform.

For iOS/Android need to wait for C ABI engine.

Hope the above information can help you.

@RGusse
Copy link

RGusse commented Jan 17, 2024

@RGusse I want to confirm your running process:

  1. Develop on WIndows and run npx prisma generate to generate Dart Prisma client code.
  2. Submit the generated Client code to the repo
  3. Run dart compile exe in dockerfile or Linux Server for AOT compilation
  4. run the compiled exe?

Second possibility: Are you running the ORM in a Flutter App?

NOTE: Prisma Client Dart does not currently support Flutter, I'm waiting for Prisma's C ABI engine.

If it's the first possibility, you may need to fix it as follows:

  1. You should not submit the code generated by npx prisma generate to the repo, please remove it (it will leak necessary information about your system, including database connection address and password)
  2. Use npx prisma generate to generate the client on the platform you will eventually run on.
  3. You will find that after the generation is completed, there will be an additional prisma-query-engine file in your project directory. Please place it in the same location as the dart compile exe output file.

The above is the method for 4.0.0-beta version. For 3.x version, prisma-query-engine is located in the Client code output directory (usually in lib/src/generated/prisma_client).

But I see that your error message is Flutter: ERROR. I guess you used it in the Flutter project. Currently, using package:orm in Flutter only supports Windows, macOS, Linux platform.

For iOS/Android need to wait for C ABI engine.

Hope the above information can help you.

I'm using it in a Flutter application.
I hadn't seen this non-support message.

Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants