Typescript runtime error: cannot read property of undefined (enum) : <p>I have the following interface and enum in a file <em>RESTConfig.ts</em>:</p>

<pre><code>export const enum RESTMethod {
   POST = "POST",
   GET = "GET"
}

export interface RESTConfig {
   url: string;
   method: RESTMethod;
   data: any;
}
</code></pre>

<p>I want to import and use the enum in another class as such:</p>

<pre><code>import { RESTConfig, RESTMethod } from './RESTConfig';

class Pipelines {
   ...
   private someMethod() {
      let rest: RESTConfig = {
         url: "",
         method: RESTMethod.POST,
         data: {}
      }
      ...

   }
   ...
}
</code></pre>

<p>Linting and transpiling works fine, but at runtime I get the following error:</p>

<blockquote>
  <p>TypeError: Cannot read property 'POST' of undefined</p>
</blockquote>

<p>on the line "method: RESTMethod.POST".</p>

<p>Can someone tell me what I'm doing wrong?</p>
