<p dir="auto">When some libraries get ahold of a Promise, they don't always add an <code class="notranslate">onFulfilled</code> handler, and they don't always add an <code class="notranslate">onRejected</code> handler using <code class="notranslate">.catch()</code>. Sometimes it looks like this:</p>
<p dir="auto"><code class="notranslate">.then(undefined, onError)</code></p>
<p dir="auto">which is perfectly valid. I just experienced this error because GraphQL.js does this, for example: <a href="https://github.com/graphql/graphql-js/blob/85bfd13b5c63b4896d7643f8cd37a4f918fc5261/src/execution/execute.js#L369">https://github.com/graphql/graphql-js/blob/85bfd13b5c63b4896d7643f8cd37a4f918fc5261/src/execution/execute.js#L369</a></p>
<p dir="auto">But, <code class="notranslate">SameLoopPromise</code> always assumes that <code class="notranslate">onFulfilled</code> (<code class="notranslate">onResult</code> in its case) will be a function and tries to call it: <a href="https://github.com/zeit/next.js/blob/e13bb3f62f2c26d86cfe7bc41c0dc68456964707/lib/dynamic.js#L196">https://github.com/zeit/next.js/blob/e13bb3f62f2c26d86cfe7bc41c0dc68456964707/lib/dynamic.js#L196</a></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">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>
<p dir="auto">If no <code class="notranslate">onFulfilled</code> handler is passed, don't try calling it.</p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto"><code class="notranslate">TypeError: onResult is not a function</code></p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<p dir="auto">Return an <code class="notranslate">import()</code> result that another library attaches a handler to like <code class="notranslate">.then(undefined, onError)</code>. In my case: write a GraphQL resolver that returns the result of <code class="notranslate">import()</code>.</p>
<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>3.2.1</td>
</tr>
<tr>
<td>node</td>
<td>8.2.1</td>
</tr>
</tbody>
</table>
<p dir="auto">example of styled-jsx-postcss broken after commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/vercel/next.js/commit/559c25253ea4a50fbc04ef37f466d9e9b616512a/hovercard" href="https://github.com/vercel/next.js/commit/559c25253ea4a50fbc04ef37f466d9e9b616512a"><tt>559c252</tt></a></p>
<ul dir="auto">
<li>[x ] 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>
<p dir="auto">The custom babel-present.js in example can modify the <code class="notranslate">next/babel</code></p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">after commit, <code class="notranslate">next/babel</code> became a function and cannot be modified</p>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>
<ol dir="auto">
<li>Use example in here next.js/examples/with-styled-jsx-postcss/</li>
<li>run dev</li>
</ol>
<h2 dir="auto">Context</h2>
<p dir="auto">We use styled-jsx-postcss, but since we want to update to the latest of next, it got broken</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>4.0.1</td>
</tr>
<tr>
<td>node</td>
<td>v6.11.3</td>
</tr>
</tbody>
</table>