<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>


<h2 dir="auto">Current Behavior</h2>


<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>windows 10 platform npm run build</li>
<li>Error: EISDIR: illegal operation on a directory, open 'E:\react\react-server-render.next'</li>
</ol>
<h2 dir="auto">Context</h2>


<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>2.4.7</td>
</tr>
<tr>
<td>node</td>
<td>v6.10.3</td>
</tr>
<tr>
<td>windows</td>
<td>10</td>
</tr>
</tbody>
</table>
<ul dir="auto">
<li>[x ] I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">Links can be used in tests that are run with Jest.</p>
<h2 dir="auto">Current Behavior</h2>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" at throwIfNoRouter (node_modules/next/dist/lib/router/index.js:107:11)
      at Object.SingletonRouter.(anonymous function) [as prefetch] (node_modules/next/dist/lib/router/index.js:69:5)
      at Link.prefetch (node_modules/next/dist/lib/link.js:143:24)
      at Link.componentDidMount (node_modules/next/dist/lib/link.js:148:12)
      at commitLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:8770:24)
      at commitAllLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:9946:9)"><pre class="notranslate"><code class="notranslate"> at throwIfNoRouter (node_modules/next/dist/lib/router/index.js:107:11)
      at Object.SingletonRouter.(anonymous function) [as prefetch] (node_modules/next/dist/lib/router/index.js:69:5)
      at Link.prefetch (node_modules/next/dist/lib/link.js:143:24)
      at Link.componentDidMount (node_modules/next/dist/lib/link.js:148:12)
      at commitLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:8770:24)
      at commitAllLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:9946:9)
</code></pre></div>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>
<p dir="auto"><code class="notranslate">"next": "^5.0.1-canary.15",</code></p>
</li>
<li>
<p dir="auto">Create a component with a render method like that returns: (partial):</p>
</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import Link from 'next/link';
...
render() {
...
    return (
&lt;h3&gt;{messages.LABEL}&lt;/h3&gt;
            &lt;ul&gt;
              &lt;li&gt;
                &lt;Link prefetch href={messages.LINK1_URL || ''}&gt;
                  &lt;a&gt;{messages.LINK1_LABEL || ''}&lt;/a&gt;
                &lt;/Link&gt;
              &lt;/li&gt;
              &lt;li&gt;"><pre class="notranslate"><code class="notranslate">import Link from 'next/link';
...
render() {
...
    return (
&lt;h3&gt;{messages.LABEL}&lt;/h3&gt;
            &lt;ul&gt;
              &lt;li&gt;
                &lt;Link prefetch href={messages.LINK1_URL || ''}&gt;
                  &lt;a&gt;{messages.LINK1_LABEL || ''}&lt;/a&gt;
                &lt;/Link&gt;
              &lt;/li&gt;
              &lt;li&gt;
</code></pre></div>
<p dir="auto">3.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import React from 'react';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import enzymify from 'expect-enzyme';
import IndexPage from '../../pages/index';

const {shallow, mount} = Enzyme;
Enzyme.configure({adapter: new Adapter()});

describe('Index', () =&gt; {
  it('Renders', () =&gt; {
    const messages = {
        LABEL: 'Maguffin'
    };

    const indexPage = mount(
      &lt;IndexPage
        country=&quot;us&quot;
        language=&quot;en&quot;
        path=&quot;/&quot;
        messageBases={messages}
      /&gt;
    );"><pre class="notranslate"><code class="notranslate">import React from 'react';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import enzymify from 'expect-enzyme';
import IndexPage from '../../pages/index';

const {shallow, mount} = Enzyme;
Enzyme.configure({adapter: new Adapter()});

describe('Index', () =&gt; {
  it('Renders', () =&gt; {
    const messages = {
        LABEL: 'Maguffin'
    };

    const indexPage = mount(
      &lt;IndexPage
        country="us"
        language="en"
        path="/"
        messageBases={messages}
      /&gt;
    );
</code></pre></div>
<ol start="4" dir="auto">
<li><code class="notranslate"> jest -t Index</code></li>
</ol>
<h2 dir="auto">Context</h2>
<p dir="auto">I'm trying to write a Jest test for a page that has a <code class="notranslate">next/link</code> on it.</p>
<h2 dir="auto">Your Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>^5.0.1-canary.15</td>
</tr>
<tr>
<td>node</td>
<td>9</td>
</tr>
<tr>
<td>OS</td>
<td>OSX 10.12</td>
</tr>
<tr>
<td>browser</td>
<td>n/a</td>
</tr>
<tr>
<td>etc</td>
<td></td>
</tr>
</tbody>
</table>