<ul class="contains-task-list">
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the <code class="notranslate">@types/lodash</code> package and had problems.</p>
</li>
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I tried using the latest stable version of tsc. <a href="https://www.npmjs.com/package/typescript" rel="nofollow">https://www.npmjs.com/package/typescript</a></p>
</li>
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have a question that is inappropriate for <a href="https://stackoverflow.com/" rel="nofollow">StackOverflow</a>.</p>
</li>
<li>
<p dir="auto">Authors: <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/bczengel/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/bczengel">@bczengel</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/chrootsu/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/chrootsu">@chrootsu</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/stepancar/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/stepancar">@stepancar</a></p>
</li>
</ul>
<h3 dir="auto">Ref</h3>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="271294027" data-permission-text="Title is private" data-url="https://github.com/lodash/lodash/issues/3475" data-hovercard-type="issue" data-hovercard-url="/lodash/lodash/issues/3475/hovercard" href="https://github.com/lodash/lodash/issues/3475">lodash/lodash#3475</a></p>
<h2 dir="auto">Error Details</h2>
<h3 dir="auto">Code</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import * as _ from &quot;lodash&quot;;
const res = _.chain([1, 2, 3]).take(1);"><pre class="notranslate"><code class="notranslate">import * as _ from "lodash";
const res = _.chain([1, 2, 3]).take(1);
</code></pre></div>
<h3 dir="auto">Error</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sh-3.2# tsc
index.ts(3,13): error TS2684: The 'this' context of type 'LoDashExplicitWrapper&lt;number[]&gt;' is not assignable to method's 'this' of type'LoDashExplicitWrapper&lt;ArrayLike&lt;number&gt; | null | undefined&gt;'.  Types of property 'push' are incompatible.
    Type '&lt;T&gt;(this: _.LoDashExplicitWrapper&lt;ArrayLike&lt;T&gt; | null | undefined&gt;, ...items: T[]) =&gt; _.LoDashExp...' is not assignable to typ
e '&lt;T&gt;(this: _.LoDashExplicitWrapper&lt;ArrayLike&lt;T&gt; | null | undefined&gt;, ...items: T[]) =&gt; _.LoDashExp...'. Two different types with this
name exist, but they are unrelated.
      Type 'LoDashExplicitWrapper&lt;number[]&gt;' is not assignable to type 'LoDashExplicitWrapper&lt;ArrayLike&lt;number&gt; | null | undefined&gt;'.
sh-3.2#"><pre class="notranslate"><code class="notranslate">sh-3.2# tsc
index.ts(3,13): error TS2684: The 'this' context of type 'LoDashExplicitWrapper&lt;number[]&gt;' is not assignable to method's 'this' of type'LoDashExplicitWrapper&lt;ArrayLike&lt;number&gt; | null | undefined&gt;'.  Types of property 'push' are incompatible.
    Type '&lt;T&gt;(this: _.LoDashExplicitWrapper&lt;ArrayLike&lt;T&gt; | null | undefined&gt;, ...items: T[]) =&gt; _.LoDashExp...' is not assignable to typ
e '&lt;T&gt;(this: _.LoDashExplicitWrapper&lt;ArrayLike&lt;T&gt; | null | undefined&gt;, ...items: T[]) =&gt; _.LoDashExp...'. Two different types with this
name exist, but they are unrelated.
      Type 'LoDashExplicitWrapper&lt;number[]&gt;' is not assignable to type 'LoDashExplicitWrapper&lt;ArrayLike&lt;number&gt; | null | undefined&gt;'.
sh-3.2#
</code></pre></div>
<h3 dir="auto">Environment</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ ts: '1.0.0',
  npm: '5.5.1',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.9.0',
  openssl: '1.0.2l',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.15.0',
  v8: '6.1.534.46',
  zlib: '1.2.11' }"><pre class="notranslate"><code class="notranslate">{ ts: '1.0.0',
  npm: '5.5.1',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.9.0',
  openssl: '1.0.2l',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.15.0',
  v8: '6.1.534.46',
  zlib: '1.2.11' }
</code></pre></div>
<h3 dir="auto">Typescript</h3>
<p dir="auto">version : 2.6.1<br>
target: "es6"<br>
module: "commonjs"<br>
types/lodash: 4.14.82</p>
<p dir="auto">_.chain from <code class="notranslate">@types/lodash</code> is broken on Typescript 2.6</p>
<p dir="auto">I have little knowledge of lodash internals, but the project that I'm working on uses it a lot. Using the new <code class="notranslate">@ts-ignore</code> silences the error, but I wanted to register it here.</p>
<h3 dir="auto">Reproducing:</h3>
<p dir="auto">install typescript ~2.6.0<br>
<code class="notranslate">tsc -init</code><br>
<code class="notranslate">npm i lodash @types/lodash --save</code><br>
index.ts:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import * as _ from 'lodash'

var a = _.chain([1,2,3]).map((x) =&gt; { return x + 1 })

console.log(a.value())"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-c1">*</span> <span class="pl-k">as</span> <span class="pl-s1">_</span> <span class="pl-k">from</span> <span class="pl-s">'lodash'</span>

<span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">_</span><span class="pl-kos">.</span><span class="pl-en">chain</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">map</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">x</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-en">value</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">run <code class="notranslate">tsc</code></p>
<h3 dir="auto">Result:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="index.ts(3,9): error TS2684: The 'this' context of type 'LoDashExplicitWrapper&lt;number[]&gt;' is not assignable to method's 'this' of type 'LoDashExplicitWrapper&lt;ArrayLike&lt;number&gt; | Dictionary&lt;number&gt; | NumericDictionary&lt;number&gt; | null |...'.
  Types of property 'push' are incompatible.
    Type '&lt;T&gt;(this: _.LoDashExplicitWrapper&lt;ArrayLike&lt;T&gt; | null | undefined&gt;, ...items: T[]) =&gt; _.LoDashExp...' is not assignable to type '&lt;T&gt;(this: _.LoDashExplicitWrapper&lt;ArrayLike&lt;T&gt; | null | undefined&gt;, ...items: T[]) =&gt; _.LoDashExp...'. Two different types with this name exist, but they are unrelated.
      Type 'LoDashExplicitWrapper&lt;number[]&gt;' is not assignable to type 'LoDashExplicitWrapper&lt;ArrayLike&lt;number&gt; | Dictionary&lt;number&gt; | NumericDictionary&lt;number&gt; | null |...'.
index.ts(3,31): error TS7006: Parameter 'x' implicitly has an 'any' type."><pre class="notranslate"><code class="notranslate">index.ts(3,9): error TS2684: The 'this' context of type 'LoDashExplicitWrapper&lt;number[]&gt;' is not assignable to method's 'this' of type 'LoDashExplicitWrapper&lt;ArrayLike&lt;number&gt; | Dictionary&lt;number&gt; | NumericDictionary&lt;number&gt; | null |...'.
  Types of property 'push' are incompatible.
    Type '&lt;T&gt;(this: _.LoDashExplicitWrapper&lt;ArrayLike&lt;T&gt; | null | undefined&gt;, ...items: T[]) =&gt; _.LoDashExp...' is not assignable to type '&lt;T&gt;(this: _.LoDashExplicitWrapper&lt;ArrayLike&lt;T&gt; | null | undefined&gt;, ...items: T[]) =&gt; _.LoDashExp...'. Two different types with this name exist, but they are unrelated.
      Type 'LoDashExplicitWrapper&lt;number[]&gt;' is not assignable to type 'LoDashExplicitWrapper&lt;ArrayLike&lt;number&gt; | Dictionary&lt;number&gt; | NumericDictionary&lt;number&gt; | null |...'.
index.ts(3,31): error TS7006: Parameter 'x' implicitly has an 'any' type.
</code></pre></div>
<h3 dir="auto">Dependencies:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    &quot;@types/lodash&quot;: &quot;^4.14.80&quot;,
    &quot;lodash&quot;: &quot;^4.17.4&quot;"><pre class="notranslate"><code class="notranslate">    "@types/lodash": "^4.14.80",
    "lodash": "^4.17.4"
</code></pre></div>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/aj-r/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/aj-r">@aj-r</a>,  <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/thorn0/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/thorn0">@thorn0</a>, <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/andy-ms/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/andy-ms">@andy-ms</a> any ideas?</p>