<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.<br>
But I think that this issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="276196840" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/3319" data-hovercard-type="pull_request" data-hovercard-url="/vercel/next.js/pull/3319/hovercard" href="https://github.com/vercel/next.js/pull/3319">#3319</a> can be related and maybe solve the problem.</li>
</ul>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">Based on what I have:<br>
I have a folder estructure working with <code class="notranslate">yarn workspaces</code> with multiple workspaces like:</p>
<p dir="auto">|-- packages<br>
|-- .babelrc<br>
..<br>
..<br>
..<br>
|----- shared<br>
|-------- components // named @org/components<br>
|-------- utils               // named @org/utils<br>
|----- web<br>
|------- app                  // named @org/mainApp<br>
|--------- src<br>
|------------ next.config.js<br>
|------------ .babelrc<br>
|----------- pages<br>
....<br>
...<br>
|------- otherPackage // named @org/otherPackage</p>
<p dir="auto">Where <code class="notranslate">app</code> folder is a next.js app that <strong>import</strong> code from the other components.</p>
<p dir="auto">The dev mode of next is run from root folder using <code class="notranslate">npm run web</code> that call <code class="notranslate">next packages/web/app/src</code> to allow next to found the pages folder (and <code class="notranslate">next.config.js</code> and <code class="notranslate">.babelrc</code> )</p>
<p dir="auto">After run and start compiling, and get the "success" mensaje, some errors arise in the console on web loaded.<br>
Errors referring to the use of <code class="notranslate">type</code> and <code class="notranslate">import</code> keywords in the files that comes from the imported modules (modules named as <code class="notranslate">@org/</code> that lives inside the same repo but (maybe) in other workspaces).</p>
<p dir="auto">This means that next webpack configuration is not transpiling the imported files. (the <code class="notranslate">babel-plugin-transform-flow-strip-types</code> is installed in packages/web/app and also in the root folder)</p>
<h2 dir="auto">Expected Behavior</h2>


<p dir="auto">Should not have any error with the imported files and works as expected (no problem with es6 and flow).</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>Create a project with yarn workspaces activated</li>
<li>Create at least two workspaces</li>
<li>Create a package inside a workspace that run with next</li>
<li>Import file from other workspaces</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>4.2.3</td>
</tr>
<tr>
<td>node</td>
<td>9.3.0</td>
</tr>
<tr>
<td>OS</td>
<td>macosx</td>
</tr>
<tr>
<td>browser</td>
<td>safari/chrome</td>
</tr>
<tr>
<td>yarn</td>
<td>1.3.2</td>
</tr>
</tbody>
</table>
<p dir="auto">After configuring next with a webpack function it seems that the function gets called twice during all builds which results in ForkTsCheckerWebpackPlugin running lint/ts checks twice (in my setup).</p>
<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?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Create a next config with a webpack function which console.logs something</li>
<li>Run the app and see the message log twice.</li>
</ol>
<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>canary</td>
</tr>
<tr>
<td>node</td>
<td>6.11.5</td>
</tr>
<tr>
<td>OS</td>
<td>macosx</td>
</tr>
</tbody>
</table>