Skip to content

"Property env must be of type ProcessEnv" react-app.d.ts [typescript] #5576

@dfee

Description

@dfee

Is this a bug report?

yes.

Did you try recovering your dependencies?

no.

Which terms did you search for in User Guide?

typescript.

Environment

System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
Binaries:
Node: 10.9.0 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
Browsers:
Chrome: 70.0.3538.77
Firefox: 63.0
Safari: 12.0
npmPackages:
@storybook/react: ^4.0.0-rc.3 => 4.0.0-rc.6
@types/react: ^16.4.18 => 16.4.18
@types/react-dom: ^16.0.9 => 16.0.9
react: ^16.5.2 => 16.6.0
react-dom: ^16.5.2 => 16.6.0
react-scripts: ^2.0.6-next.c662dfb0 => 2.0.6-next.c662dfb0
npmGlobalPackages:
create-react-app: 2.0.4

Steps to Reproduce

  1. Use typescript with create-react-app.
  2. Inspect react-app.d.ts
  3. Observe the following error:
[ts] Subsequent property declarations must have the same type.  Property 'env' must be of type 'ProcessEnv', but here has type '{ [key: string]: string | undefined; NODE_ENV: "development" | "production" | "test"; PUBLIC_URL: string; }'.
(property) NodeJS.Process.env: ProcessEnv

Expected Behavior

I assume that env should extend ProcessEnv

Actual Behavior

[ts] Subsequent property declarations must have the same type.  Property 'env' must be of type 'ProcessEnv', but here has type '{ [key: string]: string | undefined; NODE_ENV: "development" | "production" | "test"; PUBLIC_URL: string; }'.
(property) NodeJS.Process.env: ProcessEnv

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions