<p dir="auto">Error message says:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'Foo'."><pre class="notranslate"><code class="notranslate">error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'Foo'.
</code></pre></div>
<p dir="auto">Given the exact same exported type, Typescript isn't able to deal with enums from multiple source locations. Here's an example with a Core project and a Bar project:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Core/
  foo.ts
  convertFooToString.ts
  dist/
    foo.js
    foo.d.ts
    convertFooToString.ts
    convertFooToString.d.ts

Bar/
  SomeComponent.tsx
  dist/
    SomeComponent.js
    SomeComponent.d.ts"><pre class="notranslate"><code class="notranslate">Core/
  foo.ts
  convertFooToString.ts
  dist/
    foo.js
    foo.d.ts
    convertFooToString.ts
    convertFooToString.d.ts

Bar/
  SomeComponent.tsx
  dist/
    SomeComponent.js
    SomeComponent.d.ts
</code></pre></div>
<p dir="auto">SomeComponent.tsx:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// some other imports
import {convertFooToString}
export default class SomeComponent extends React.Component&lt;any, any&gt; {
  render() {
    // Note, this.props.foo IS a Foo type
    return (&lt;div&gt;{convertFooToString(this.props.foo)}&lt;/div&gt;);
  }
}"><pre class="notranslate"><span class="pl-c">// some other imports</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">convertFooToString</span><span class="pl-kos">}</span>
<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">class</span> <span class="pl-v">SomeComponent</span> <span class="pl-k">extends</span> <span class="pl-v">React</span><span class="pl-kos">.</span><span class="pl-c1">Component</span><span class="pl-c1">&lt;</span><span class="pl-s1">any</span><span class="pl-kos">,</span> <span class="pl-s1">any</span><span class="pl-c1">&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// Note, this.props.foo IS a Foo type</span>
    <span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-c1">&lt;</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span><span class="pl-kos">{</span><span class="pl-en">convertFooToString</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">props</span><span class="pl-kos">.</span><span class="pl-c1">foo</span><span class="pl-kos">)</span><span class="pl-kos">}</span><span class="pl-c1">&lt;</span><span class="pl-c1">/</span><span class="pl-ent">div</span><span class="pl-c1">&gt;</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">foo.ts:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="enum Foo {
  Yay = 0,
  Nay = 1
};

export default Foo;"><pre class="notranslate"><span class="pl-s1">enum</span> <span class="pl-v">Foo</span> <span class="pl-kos">{</span>
  <span class="pl-v">Yay</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">,</span>
  <span class="pl-v">Nay</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-v">Foo</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">convertFooToString:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export function convertFooToString(foo: Foo): string {
    switch (foo) {
        case Foo.Yay:
            return &quot;YAYAYAYAYA&quot;;
        default:
            return &quot;NANANANANA&quot;;
    }
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">function</span> <span class="pl-en">convertFooToString</span><span class="pl-kos">(</span><span class="pl-s1">foo</span>: <span class="pl-v">Foo</span><span class="pl-kos">)</span>: <span class="pl-s1">string</span> <span class="pl-kos">{</span>
    <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">foo</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">case</span> <span class="pl-v">Foo</span><span class="pl-kos">.</span><span class="pl-c1">Yay</span>:
            <span class="pl-k">return</span> <span class="pl-s">"YAYAYAYAYA"</span><span class="pl-kos">;</span>
        <span class="pl-k">default</span>:
            <span class="pl-k">return</span> <span class="pl-s">"NANANANANA"</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The error relates to enums, and exports using the new typescript node resolution (with the typings property in the package.json). I have tested this on typescript@next.</p>
<p dir="auto">The bug can be reproduced through the following scenario: (please go to <a href="https://github.com/christyharagan/typeScript-enum-export-bug">https://github.com/christyharagan/typeScript-enum-export-bug</a> to find this code):</p>
<p dir="auto">Three projects: <code class="notranslate">a</code>, <code class="notranslate">b</code>, <code class="notranslate">c</code>.</p>
<p dir="auto"><code class="notranslate">b</code> depends on <code class="notranslate">a</code><br>
<code class="notranslate">c</code> depends on <code class="notranslate">b</code></p>
<p dir="auto"><code class="notranslate">a</code> exports an enum through its index.ts:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export enum E{}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">enum</span> <span class="pl-smi">E</span><span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto"><code class="notranslate">b</code> then exports a function that returns <code class="notranslate">E</code> through its index.ts:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {E} from 'a'
export function f():E {
  return null
}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-smi">E</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'a'</span>
<span class="pl-k">export</span> <span class="pl-k">function</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span>:<span class="pl-smi">E</span> <span class="pl-kos">{</span>
  <span class="pl-k">return</span> <span class="pl-c1">null</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><code class="notranslate">c</code> then consumes <code class="notranslate">f</code> through its index.ts:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import {E} from 'a'
import {f} from 'b'

let e:E = f()"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-smi">E</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'a'</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span><span class="pl-s1">f</span><span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'b'</span>

<span class="pl-k">let</span> <span class="pl-s1">e</span>:<span class="pl-smi">E</span> <span class="pl-c1">=</span> <span class="pl-en">f</span><span class="pl-kos">(</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">There is now an error for <code class="notranslate">e</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Type 'E' is not assignable to type 'E'."><pre class="notranslate"><code class="notranslate">Type 'E' is not assignable to type 'E'.
</code></pre></div>
<p dir="auto">All three packages have a package.json that looks like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;b&quot;,
  &quot;version&quot;: &quot;1&quot;,
  &quot;main&quot;: &quot;lib/index.js&quot;,
  &quot;typings&quot;: &quot;lib/index.d.ts&quot;,
  &quot;dependencies&quot;: {
    &quot;a&quot;: &quot;1&quot;
  }
}"><pre class="notranslate"><code class="notranslate">{
  "name": "b",
  "version": "1",
  "main": "lib/index.js",
  "typings": "lib/index.d.ts",
  "dependencies": {
    "a": "1"
  }
}
</code></pre></div>
<p dir="auto">And a tsconfig.json that looks like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;compilerOptions&quot;: {
        &quot;declaration&quot;: true,
        &quot;module&quot;: &quot;commonjs&quot;,
        &quot;rootDir&quot;: &quot;./src&quot;,
        &quot;target&quot;: &quot;es5&quot;,
        &quot;outDir&quot;: &quot;./lib&quot;
    },
    &quot;files&quot;: [
        &quot;src/index.ts&quot;
    ]
}"><pre class="notranslate"><code class="notranslate">{
    "compilerOptions": {
        "declaration": true,
        "module": "commonjs",
        "rootDir": "./src",
        "target": "es5",
        "outDir": "./lib"
    },
    "files": [
        "src/index.ts"
    ]
}
</code></pre></div>
<p dir="auto">Furthermore, this defect occurs if <code class="notranslate">f</code> were to export another symbol (e.g. an interface) which references an exported enum somewhere within it's structure or hierarchy.</p>
<p dir="auto">This only seems to affect enums, not other types.</p>