graphql-debugger icon indicating copy to clipboard operation
graphql-debugger copied to clipboard

`postinstall` problem with `npx prisma db push`

Open binary64 opened this issue 1 year ago • 4 comments

Hi,

I have @graphql-debugger/trace-schema installed in my project. But when I do yarn install I get this during the "Building fresh packages..." stage:

error /home/user/monorepo/node_modules/@graphql-debugger/data-access: Command failed.
Exit code: 1
Command: npx prisma generate && npx prisma db push
Arguments: 
Directory: /home/user/monorepo/node_modules/@graphql-debugger/data-access

However this is actually running prisma generate against my own schema, which is defined in my root package.json under the prisma > schema keys. And then I get error: Environment variable not found: DATABASE_URL..

If I do a yarn why I get

$ yarn why @graphql-debugger/data-access
yarn why v1.22.19
[1/4] Why do we have the module "@graphql-debugger/data-access"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "@graphql-debugger/[email protected]"
info Reasons this module exists
   - "@graphql-debugger#trace-schema#@graphql-debugger#utils" depends on it
   - Hoisted from "@graphql-debugger#trace-schema#@graphql-debugger#utils#@graphql-debugger#data-access"
   - Hoisted from "graphql-debugger#@graphql-debugger#backend#@graphql-debugger#adapter-sqlite#@graphql-debugger#data-access"
info Disk size without dependencies: "114.06MB"
info Disk size with unique dependencies: "158.89MB"
info Disk size with transitive dependencies: "224.26MB"
info Number of shared dependencies: 104

But I am not using the sqlite adapter, I'm sending to OpenTelemetery.

Many thanks for this

binary64 avatar Apr 24 '24 06:04 binary64

It could be an issue in how we spawn the db for debugger in your node modules dir.

See the postinstall script

  • https://github.com/rocket-connect/graphql-debugger/blob/main/packages/data-access/package.json#L18

We are looking into a fix for you, thank you for reporting.

danstarns avatar Apr 26 '24 12:04 danstarns

@binary64 can you share your package.json file? You might not need data access installed

danstarns avatar Apr 26 '24 12:04 danstarns

I searched for "graphql-debugger" and get 2 hits:

    "graphql-debugger": "0.0.0-alpha.99",
    "@graphql-debugger/trace-schema": "0.0.0-alpha.99",

binary64 avatar Apr 26 '24 19:04 binary64

I searched for "graphql-debugger" and get 2 hits:

    "graphql-debugger": "0.0.0-alpha.99",
    "@graphql-debugger/trace-schema": "0.0.0-alpha.99",

Its graphql-debugger that depends on the SQL lite adapter, you can remove it, and if you wish to use the debugger UI locally use docker - this way you wont get this conflict.

danstarns avatar Apr 27 '24 02:04 danstarns