<p dir="auto">Running <code class="notranslate">npm run install</code> and <code class="notranslate">npm run start --p 3000</code> locally works no issues using same version of node.<br>
Once deployed using the package.json below I'm receiving errors as in the Heroku Logs below.<br>
Big thanks for all the effort being put into this project.</p>
<p dir="auto">package.json</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;xxx&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;engines&quot;: {
    &quot;node&quot;: &quot;6.9.1&quot;
  },
  &quot;dependencies&quot;: {
    &quot;glamor&quot;: &quot;2.20.20&quot;,
    &quot;google-map-react&quot;: &quot;0.22.0&quot;,
    &quot;google-maps-react&quot;: &quot;1.0.19&quot;,
    &quot;isomorphic-fetch&quot;: &quot;2.2.1&quot;,
    &quot;lodash.range&quot;: &quot;3.2.0&quot;,
    &quot;next&quot;: &quot;2.0.0-beta.15&quot;,
    &quot;numeral&quot;: &quot;2.0.3&quot;,
    &quot;react-bootstrap&quot;: &quot;0.30.6&quot;,
    &quot;react-google-maps&quot;: &quot;6.0.1&quot;,
    &quot;react-inlinesvg&quot;: &quot;0.5.4&quot;,
    &quot;react-input-range&quot;: &quot;0.9.3&quot;,
    &quot;react-redux&quot;: &quot;4.4.5&quot;,
    &quot;react-select&quot;: &quot;1.0.0-rc.2&quot;,
    &quot;react-slick&quot;: &quot;0.14.5&quot;,
    &quot;react-svg-pan-zoom&quot;: &quot;2.2.2&quot;,
    &quot;redux&quot;: &quot;3.6.0&quot;,
    &quot;redux-form&quot;: &quot;6.2.1&quot;,
    &quot;redux-thunk&quot;: &quot;2.1.0&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;browser-sync&quot;: &quot;2.18.2&quot;,
    &quot;bootstrap-sass&quot;: &quot;3.3.7&quot;,
    &quot;gulp&quot;: &quot;3.9.1&quot;,
    &quot;gulp-sass&quot;: &quot;2.3.2&quot;
  },
  &quot;scripts&quot;: {
    &quot;dev&quot;: &quot;next&quot;,
    &quot;install&quot;: &quot;next build&quot;,
    &quot;start&quot;: &quot;next start -p ${PORT}&quot;
  }
}"><pre class="notranslate"><code class="notranslate">{
  "name": "xxx",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "engines": {
    "node": "6.9.1"
  },
  "dependencies": {
    "glamor": "2.20.20",
    "google-map-react": "0.22.0",
    "google-maps-react": "1.0.19",
    "isomorphic-fetch": "2.2.1",
    "lodash.range": "3.2.0",
    "next": "2.0.0-beta.15",
    "numeral": "2.0.3",
    "react-bootstrap": "0.30.6",
    "react-google-maps": "6.0.1",
    "react-inlinesvg": "0.5.4",
    "react-input-range": "0.9.3",
    "react-redux": "4.4.5",
    "react-select": "1.0.0-rc.2",
    "react-slick": "0.14.5",
    "react-svg-pan-zoom": "2.2.2",
    "redux": "3.6.0",
    "redux-form": "6.2.1",
    "redux-thunk": "2.1.0"
  },
  "devDependencies": {
    "browser-sync": "2.18.2",
    "bootstrap-sass": "3.3.7",
    "gulp": "3.9.1",
    "gulp-sass": "2.3.2"
  },
  "scripts": {
    "dev": "next",
    "install": "next build",
    "start": "next start -p ${PORT}"
  }
}
</code></pre></div>
<p dir="auto">Heroku Logs</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{ Error: Cannot find module '/tmp/build_64ddcd154cf30721ff7251c45faf0a03/node_modules/next/dist/server/document.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (/app/.next/dist/pages/_document.js:3:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module '/tmp/build_64ddcd154cf30721ff7251c45faf0a03/node_modules/babel-runtime/core-js/object/get-prototype-of'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (/app/.next/dist/pages/_error.js:7:23)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }"><pre class="notranslate"><code class="notranslate">{ Error: Cannot find module '/tmp/build_64ddcd154cf30721ff7251c45faf0a03/node_modules/next/dist/server/document.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (/app/.next/dist/pages/_document.js:3:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module '/tmp/build_64ddcd154cf30721ff7251c45faf0a03/node_modules/babel-runtime/core-js/object/get-prototype-of'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (/app/.next/dist/pages/_error.js:7:23)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }
</code></pre></div>
<h1 dir="auto">Bug report</h1>
<h2 dir="auto">Describe the bug</h2>
<p dir="auto">First bug report so patience appreciated. Following an installation of @material-ui/core receive "Invalid hook call". Traced the issue back to any hook in general and react installation location.</p>
<h2 dir="auto">To Reproduce</h2>
<p dir="auto">Created simple standard folder structure:<br>
src<br>
|--components<br>
|--pages<br>
|--package.json<br>
|--next.config.js<br>
|--etc. etc.<br>
public<br>
|--placeholder.html<br>
|--404.html<br>
functions<br>
|--index.js<br>
|--package.json</p>
<p dir="auto">Functions package.json is identical with additional <code class="notranslate">firebase-admin</code> and <code class="notranslate">firebase-functions</code></p>
<p dir="auto">Once you add @material-ui/core and make a simple button get:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."><pre class="notranslate"><code class="notranslate">Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
</code></pre></div>
<p dir="auto">Changing the button to simple <code class="notranslate">&lt;button onClick={...}&gt;Click Me&lt;/button&gt;</code> works.</p>
<p dir="auto">On deploy, the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error occurred prerendering page &quot;/&quot; https://err.sh/zeit/next.js/prerender-error: Error: Minified React error #321"><pre class="notranslate"><code class="notranslate">Error occurred prerendering page "/" https://err.sh/zeit/next.js/prerender-error: Error: Minified React error #321
</code></pre></div>
<h2 dir="auto">Expected behavior</h2>
<p dir="auto">Easy implementation of <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/material-ui/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/material-ui">@material-ui</a></p>
<h2 dir="auto">Screenshots</h2>
<p dir="auto">If applicable, add screenshots to help explain your problem.</p>
<h2 dir="auto">System information</h2>
<p dir="auto">linux ubuntu</p>
<h2 dir="auto">Additional context</h2>
<p dir="auto">This is not a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="458998600" data-permission-text="Title is private" data-url="https://github.com/vercel/next.js/issues/7626" data-hovercard-type="issue" data-hovercard-url="/vercel/next.js/issues/7626/hovercard" href="https://github.com/vercel/next.js/issues/7626">#7626</a></p>