denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.52k stars 5.18k forks source link

`Warning: Not implemented: ChildProcess.prototype.disconnect` when using Prisma #17265

Open Jolg42 opened 1 year ago

Jolg42 commented 1 year ago

When using prisma generate we can see in the logs at the bottom

Warning: Not implemented: ChildProcess.prototype.disconnect

Full example

deno run -A --unstable npm:prisma generate --data-proxy
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
napi_add_env_cleanup_hook is currently not supported
✔ Created ./package.json

added 2 packages, and audited 3 packages in 7s

found 0 vulnerabilities

added 2 packages, and audited 5 packages in 9s

found 0 vulnerabilities

✔ Installed the @prisma/client and prisma packages in your project

✔ Generated Prisma Client (4.9.0-dev.15 | dataproxy) to .\node_modules\@prisma\client in 164ms
You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()

To use Prisma Client in edge runtimes like Cloudflare Workers or Vercel Edge Functions, import it like this:
import { PrismaClient } from '@prisma/client/edge'

You will need a Prisma Data Proxy connection string. See documentation: https://pris.ly/d/data-proxy

Warning: Not implemented: ChildProcess.prototype.disconnect

What triggers it is the telemetry in the Prisma CLI which does the following

  // Spawn the child to send telemetry request
  const child = spawn(state)
  child.unref()
  // Closes the IPC channel between parent and child
  child.disconnect()

And the warning can be found at https://github.com/denoland/deno_std/blob/b4239898d6c6b4cdbfd659a4ea1838cf4e656336/node/internal/child_process.ts#L273

It does not impact the functionality as far as we know, but it could be scary for users who might think something is broken (although it is not).

Is it planned to be implemented, maybe? I'm curious to know what you think about this.

birkskyum commented 5 months ago

Hit this with the latest Remix:

Version: Deno 1.40.5

Repro:

 deno run -A npm:create-remix@latest --template remix-run/remix/templates/vite         

 remix   v2.4.0 💿 Let's build a better website...

   dir   Where should we create your new project?
         ./new-remix-4

      ◼  Template: Using remix-run/remix/templates/vite...
      ✔  Template copied

   git   Initialize a new git repository?
         Yes

  deps   Install dependencies with npm?
         Yes

Warning: Not implemented: ChildProcess.prototype.disconnect

After the Install dependencies with npm? it'll hang, because it can't disconnect, and when I interrupt it with ctrl-c, then it'll prompt the warning. Related:

birkskyum commented 5 months ago

@Jolg42 , try this with deno upgrade --canary. It should be fixed in: