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.

Packaged CLI cannot be used to generate the JS client

See original GitHub issue

Bug description

If the CLI is packaged into a single binary using pkg then it cannot be used to generate the JS client.

How to reproduce

https://github.com/RobertCraigie/prisma-pkg-reproduction

Expected behavior

The Client should be correctly generated.

Prisma information

N/A

Environment & setup

  • OS: Mac OS
  • Database: N/A/
  • Node.js version: v17.1.0

Prisma Version

prisma                  : 3.6.0
@prisma/client          : 3.6.0
Current platform        : darwin
Query Engine (Node-API) : libquery-engine dc520b92b1ebb2d28dc3161f9f82e875bd35d727 (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine        : migration-engine-cli dc520b92b1ebb2d28dc3161f9f82e875bd35d727 (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine    : introspection-core dc520b92b1ebb2d28dc3161f9f82e875bd35d727 (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary           : prisma-fmt dc520b92b1ebb2d28dc3161f9f82e875bd35d727 (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash    : dc520b92b1ebb2d28dc3161f9f82e875bd35d727
Studio                  : 0.440.0

Additional Context

The packaged CLI is currently being used by prisma-client-go and https://github.com/RobertCraigie/prisma-client-py

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Dec 4, 2021

Aha, so my reproduction is getting the same right now - which seems to be the “figure out the command to run this generator to make it generate” code which is then used here https://github.com/prisma/prisma/blob/bbdf1c23653a77b0b5bf7d62efd243dcebea018b/packages/generator-helper/src/GeneratorProcess.ts#L45-L51

Seems by hand coding the provider path you are effectively skipping over that small problem already and are allowing it to succeed further. Interesting.

1reaction
janpiocommented, Dec 3, 2021

Unfortunately lives in a non obvious location: https://github.com/prisma/engines-wrapper/blob/7195c6e751d3661cfc5df1e1126789b88c291494/packages/engines/src/index.ts#L17-L25 (Quite a smell that this logic is in 2 different repos although closely related)

Read more comments on GitHub >

github_iconTop Results From Across the Web

What could cause an error related to npm not being able to ...
js, npm, angular-cli, and typescript and then installed yarn. I was able to run yarn successfully and then I was able to run...
Read more >
How to build a CLI with Node.js - Twilio
In this post we'll look at why you might want to write a CLI, how to use Node.js for it, some useful packages...
Read more >
Troubleshooting AWS CLI errors - AWS Command Line Interface
This error means that the operating system can't find the AWS CLI command. The installation might be incomplete or requires updating. ... Example...
Read more >
Getting Started - ESBuild
node_modules/.bin/esbuild app.jsx --bundle --outfile=out.js ... CLI JS Go ... Some npm packages you want to use may not be designed to be run...
Read more >
Babel CLI
Babel comes with a built-in CLI which can be used to compile files from the ... Note: If you do not have a...
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