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

node: Using V8 flags when spawning a subprocess fails #2411

Closed
bartlomieju opened this issue Jul 2, 2022 · 1 comment
Closed

node: Using V8 flags when spawning a subprocess fails #2411

bartlomieju opened this issue Jul 2, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@bartlomieju
Copy link
Member

Describe the bug

When Node compat spawns a subprocess that uses V8 flags, we get an error. This is caused by the fact, that Node accepts V8 flags as "top level" CLI flags, whereas Deno requires them to be a value to --v8-flags= CLI flag.

Quick idea to fix it is to get a list of all V8 flags (deno run --v8-flags=--help) and embed them somewhere in std/node, then when spawning a subprocess iterate over provided arguments and manually contructs --v8-flags= CLI flag passed to Deno).

Steps to Reproduce

env DENO_NODE_COMPAT_URL=file:///Users/ib/dev/deno_std/ env PRISMA_CLIENT_ENGINE_TYPE=binary env PRISMA_CLI_QUERY_ENGINE_TYPE=binary deno run -A --compat --unstable ./node_modules/.bin/prisma generate --data-proxy
Not implemented: process.on("uncaughtException")
Not implemented: process.on("unhandledRejection")
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Generator at /Users/ib/dev/prisma_test/starter/node_modules/@prisma/client/generator-build/index.js could not start:

error: Found argument '--max-old-space-size' which wasn't expected, or isn't valid in this context
	If you tried to supply `--max-old-space-size` as a value rather than a flag, use `-- --max-old-space-size`
USAGE:
    deno run --compat --unstable --no-check[=<NO_CHECK_TYPE>...] --allow-all <SCRIPT_ARG>...
For more information try --help

Expected behavior

No error thrown.

CC @kt3k

@bartlomieju bartlomieju added bug Something isn't working needs triage node and removed needs triage labels Jul 2, 2022
@kt3k
Copy link
Member

kt3k commented Jul 21, 2022

solved in #2424

@kt3k kt3k closed this as completed Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants