Skip to content

how do you run in a typescript app? #12

@imranity

Description

@imranity

im new to react but my react app is created in typescript. when i follow your tutorial , i get

Failed to compile.

......SomeFile.tsx
Type error: Property '_env_' does not exist on type 'Window'.  TS2339

    12 |         }
    13 | 
  > 14 |         return window._env_.REACT_APP_BACKEND_API_BASE_URL + '/rest';
       |                       ^
    15 |     }
    16 | 
    17 |     protected withResponseCheck(promise: Promise<any>, returnJson: boolean): Promise<any> {

i confirmed my env-config.js generated inside public has window.__env__ being set

window._env_ = {
  REACT_APP_BACKEND_API_BASE_URL: "http://localhost:5000"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions