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

Incorrect typing of ProcessEnv #9718

Open
ehmicky opened this issue Jul 5, 2024 · 0 comments
Open

Incorrect typing of ProcessEnv #9718

ehmicky opened this issue Jul 5, 2024 · 0 comments

Comments

@ehmicky
Copy link

ehmicky commented Jul 5, 2024

Reproduction

TypeScript playground.

import {spawn} from 'node:child_process'
import "@remix-run/node"

spawn('echo', ['example'], {env: {EXAMPLE: 'example'}})

Gives the following type error (only if @remix-run/node is imported):

No overload matches this call.
  The last overload gave the following error.
    Property 'NODE_ENV' is missing in type '{ EXAMPLE: string; }' but required in type 'ProcessEnv'.

System Info

This is using the TypeScript playground.

Used Package Manager

npm

Expected Behavior

Passing the env option to child_process.spawn() should not produce a type error.

This seems to be related to:

interface ProcessEnv {
NODE_ENV: "development" | "production" | "test";
}

Actual Behavior

There is a type error.

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

No branches or pull requests

2 participants