<p dir="auto">Hi,</p>
<p dir="auto">In visual studio, i got this error in every d.ts file under node_modules\rxjs\add\observable\ :<br>
<strong>Invalid module name in augmentation, module '../../Observable' cannot be found.</strong><br>
example code: <strong>declare module '../../Observable' {</strong></p>
<p dir="auto">how to fix that please?</p>
<p dir="auto">I have a class called Webpack, which I augment to add a new method <code class="notranslate">addLess</code> like so:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// addLess.ts
import { Webpack } from '../webpack';

declare module '../webpack' {
    interface Webpack {
        addLess(): Webpack;
    }
}

const lessConfiguration = {
    module: {
        loaders: [
            { test: /\.less$/, loader: &quot;style!css!less&quot; }
        ]
    }
};

class Implementation extends Webpack {
    addLess(): Webpack {
        return this.mergeModule('less', lessConfiguration);
    }
}

Webpack.prototype.addLess = Implementation.prototype.addLess;"><pre class="notranslate"><span class="pl-c">// addLess.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Webpack</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'../webpack'</span><span class="pl-kos">;</span>

<span class="pl-k">declare</span> module <span class="pl-s">'../webpack'</span> <span class="pl-kos">{</span>
    <span class="pl-k">interface</span> <span class="pl-smi">Webpack</span> <span class="pl-kos">{</span>
        <span class="pl-c1">addLess</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">Webpack</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">const</span> <span class="pl-s1">lessConfiguration</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">module</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">loaders</span>: <span class="pl-kos">[</span>
            <span class="pl-kos">{</span> <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>less<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-c1">loader</span>: <span class="pl-s">"style!css!less"</span> <span class="pl-kos">}</span>
        <span class="pl-kos">]</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">class</span> <span class="pl-smi">Implementation</span> <span class="pl-k">extends</span> <span class="pl-smi">Webpack</span> <span class="pl-kos">{</span>
    <span class="pl-en">addLess</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">Webpack</span> <span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">mergeModule</span><span class="pl-kos">(</span><span class="pl-s">'less'</span><span class="pl-kos">,</span> <span class="pl-s1">lessConfiguration</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-smi">Webpack</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">addLess</span> <span class="pl-c1">=</span> <span class="pl-smi">Implementation</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">addLess</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">This works great in the current typescript project, but if I compile (with declarations), and try to use the compiled project in another project, the new method is not shown in intellisense in Visual Studio, and it is shown as an error if I try to use it anyway.<br>
However, if I make sure something is exported from the module above it works as expected. For example, I can work around the issue by exporting the class <code class="notranslate">Implementation</code> like so:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// addLess.ts
import { Webpack } from '../webpack';

declare module '../webpack' {
    interface Webpack {
        addLess(): Webpack;
    }
}

const lessConfiguration = {
    module: {
        loaders: [
            { test: /\.less$/, loader: &quot;style!css!less&quot; }
        ]
    }
};

export class Implementation extends Webpack {
    addLess(): Webpack {
        return this.mergeModule('less', lessConfiguration);
    }
}

Webpack.prototype.addLess = Implementation.prototype.addLess;"><pre class="notranslate"><span class="pl-c">// addLess.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Webpack</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'../webpack'</span><span class="pl-kos">;</span>

<span class="pl-k">declare</span> module <span class="pl-s">'../webpack'</span> <span class="pl-kos">{</span>
    <span class="pl-k">interface</span> <span class="pl-smi">Webpack</span> <span class="pl-kos">{</span>
        <span class="pl-c1">addLess</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">Webpack</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-k">const</span> <span class="pl-s1">lessConfiguration</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">module</span>: <span class="pl-kos">{</span>
        <span class="pl-c1">loaders</span>: <span class="pl-kos">[</span>
            <span class="pl-kos">{</span> <span class="pl-c1">test</span>: <span class="pl-pds"><span class="pl-c1">/</span><span class="pl-cce">\.</span>less<span class="pl-cce">$</span><span class="pl-c1">/</span></span><span class="pl-kos">,</span> <span class="pl-c1">loader</span>: <span class="pl-s">"style!css!less"</span> <span class="pl-kos">}</span>
        <span class="pl-kos">]</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">Implementation</span> <span class="pl-k">extends</span> <span class="pl-smi">Webpack</span> <span class="pl-kos">{</span>
    <span class="pl-en">addLess</span><span class="pl-kos">(</span><span class="pl-kos">)</span>: <span class="pl-smi">Webpack</span> <span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-en">mergeModule</span><span class="pl-kos">(</span><span class="pl-s">'less'</span><span class="pl-kos">,</span> <span class="pl-s1">lessConfiguration</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-smi">Webpack</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">addLess</span> <span class="pl-c1">=</span> <span class="pl-smi">Implementation</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">addLess</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">However, this means that I am exporting something, that should be private to the module.</p>
<p dir="auto">This issue is only in Visual Studio. When compiling with <code class="notranslate">gulp-typescript</code> using typescript 1.8.2, 1.8.5, 1.8.6 or 1.8.7 I get no errors - with or without the extra export.</p>
<p dir="auto">I am using Visual Studio 2015 update 1 with the extension for Typescript 1.8.4.</p>