title: Can't find module error when publish to heroku
body: <p>When i try to publish my NUXT Application on Heroku I Got This Error</p>
  <p>Server error
  An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.</p>
  <p>The Application Running Locally Fine Everything work.</p>
  <p>this is building logs</p>
  <pre><code>Building on the Heroku-20 stack
  remote: -----&gt; Determining which buildpack to use for this app
  remote: -----&gt; Node.js app detected
  remote:
  remote: -----&gt; Creating runtime environment
  remote:
  remote:        NPM_CONFIG_PRODUCTION=false
  remote:        NPM_CONFIG_LOGLEVEL=error
  remote:        NODE_VERBOSE=false
  remote:        NODE_ENV=production
  remote:        NODE_MODULES_CACHE=true
  remote:
  remote: -----&gt; Installing binaries
  remote:        engines.node (package.json):  unspecified
  remote:        engines.npm (package.json):   unspecified (use default)
  remote:
  remote:        Resolving node version 14.x...
  remote:        Downloading and installing node 14.16.0...
  remote:        Using default npm version: 6.14.11
  remote:
  remote: -----&gt; Installing dependencies
  remote:        Installing node modules
  remote:
  remote:        &gt; ejs@2.7.4 postinstall /tmp/build_216782e5/node_modules/ejs
  remote:        &gt; node ./postinstall.js
  remote:
  remote:
  remote:        &gt; fsevents@1.2.13 install /tmp/build_216782e5/node_modules/watchpack-chokidar2/node_modules/fsevents
  remote:        &gt; node install.js
  remote:
  remote:
  remote:        Skipping 'fsevents' build as platform linux is not supported
  remote:
  remote:        &gt; core-js@2.6.12 postinstall /tmp/build_216782e5/node_modules/@nuxt/babel-preset-app/node_modules/core-js
  remote:        &gt; node -e &quot;try{require('./postinstall')}catch(e){}&quot;
  remote:
  remote:
  remote:        &gt; nuxt@2.14.12 postinstall /tmp/build_216782e5/node_modules/nuxt
  remote:        &gt; opencollective || exit 0
  remote:
  remote:
  remote:        &gt; core-js@2.6.12 postinstall /tmp/build_216782e5/node_modules/babel-runtime/node_modules/core-js
  remote:        &gt; node -e &quot;try{require('./postinstall')}catch(e){}&quot;
  remote:
  remote:
  remote:        &gt; core-js@3.8.3 postinstall /tmp/build_216782e5/node_modules/core-js
  remote:        &gt; node -e &quot;try{require('./postinstall')}catch(e){}&quot;
  remote:
  remote:
  remote:        &gt; bcrypt@5.0.1 install /tmp/build_216782e5/node_modules/bcrypt
  remote:        &gt; node-pre-gyp install --fallback-to-build
  remote:
  remote:        [bcrypt] Success: &quot;/tmp/build_216782e5/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node&quot; is installed via remote
  remote:
  remote:        &gt; deasync@0.1.21 install /tmp/build_216782e5/node_modules/deasync
  remote:        &gt; node ./build.js
  remote:
  remote:        `linux-x64-node-14` exists; testing
  remote:        Binary is fine; exiting
  remote:        added 2157 packages in 31.908s
  remote:
  remote: -----&gt; Build
  remote:        Detected both &quot;build&quot; and &quot;heroku-postbuild&quot; scripts
  remote:        Running heroku-postbuild
  remote:
  remote:        &gt; temps4care@1.0.0 heroku-postbuild /tmp/build_216782e5
  remote:        &gt; npm run build
  remote:
  remote:
  remote:        &gt; temps4care@1.0.0 build /tmp/build_216782e5
  remote:        &gt; nuxt build
  remote:
  remote:        ℹ Using Tailwind CSS from ~/assets/css/tailwind.css
  remote:        ℹ Merging Tailwind config from ~/tailwind.config.js
  remote:
  remote:  ERROR  ServerMiddleware Error: Cannot find module '../middlewares/is-admin'
  remote: Require stack:
  remote: - /tmp/build_216782e5/api/routes/applications.js
  remote: - /tmp/build_216782e5/api/index.js
  remote: - /tmp/build_216782e5/node_modules/@nuxt/core/dist/core.js
  remote: - /tmp/build_216782e5/node_modules/@nuxt/cli/dist/cli-index.js
  remote: - /tmp/build_216782e5/node_modules/@nuxt/cli/dist/cli.js
  remote: - /tmp/build_216782e5/node_modules/nuxt/bin/nuxt.js
  remote:
  remote:   Error: Cannot find module '../middlewares/is-admin'
  remote:   Require stack:
  remote:   - api/routes/applications.js
  remote:   - api/index.js
  remote:   - node_modules/@nuxt/core/dist/core.js
  remote:   - node_modules/@nuxt/cli/dist/cli-index.js
  remote:   - node_modules/@nuxt/cli/dist/cli.js
  remote:   - node_modules/nuxt/bin/nuxt.js
  remote:   at Object.&lt;anonymous&gt; (api/routes/applications.js:5:17)
  remote:   at Generator.next (&lt;anonymous&gt;)
  remote:   at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
  remote:
  remote:        ℹ Production build
  remote:        ℹ Bundling only for client side
  remote:        ℹ Target: static
  remote:        ✔ Builder initialized
  remote:        ✔ Nuxt files generated
  remote:        ℹ Compiling Client
  remote:        ✔ Client: Compiled successfully in 46.62s
  remote:
  remote: Built at: 03/20/2021 8:43:32 AM
  remote: Entrypoint app = 04a9315.js 3dd8788.js 959bf8b.js 6f6dc41.js
  remote:        ℹ Generating output directory: dist/
  remote:        ℹ Generating pages
  remote:        ✔ Generated route &quot;/signappsucc&quot;
  remote:        ✔ Generated route &quot;/&quot;
  remote:        ✔ Generated route &quot;/admin/dashboard&quot;
  remote:        ✔ Generated route &quot;/auth/forgetpassword/message&quot;
  remote:        ✔ Generated route &quot;/auth/forgetpassword&quot;
  remote:        ✔ Generated route &quot;/auth/login&quot;
  remote:        ✔ Generated route &quot;/auth/signup&quot;
  remote:        ✔ Client-side fallback created: 200.html
  remote:
  remote: -----&gt; Caching build
  remote:        - node_modules
  remote:
  remote: -----&gt; Pruning devDependencies
  remote:        Skipping because NPM_CONFIG_PRODUCTION is 'false'
  remote:
  remote: -----&gt; Build succeeded!
  remote: -----&gt; Discovering process types
  remote:        Procfile declares types     -&gt; (none)
  remote:        Default types for buildpack -&gt; web
  remote:
  remote: -----&gt; Compressing...
  remote:        Done: 92.6M
  remote: -----&gt; Launching...
  remote:        Released v6
  remote:        https://temps4care.herokuapp.com/ deployed to Heroku
  </code></pre>
  <p>this is the logs of the heroku application</p>
  <pre><code>2021-03-20T09:08:20.116879+00:00 app[web.1]:   - api/index.js
  2021-03-20T09:08:20.116879+00:00 app[web.1]:   - node_modules/@nuxt/core/dist/core.js
  2021-03-20T09:08:20.116880+00:00 app[web.1]:   - node_modules/@nuxt/cli/dist/cli-index.js
  2021-03-20T09:08:20.116880+00:00 app[web.1]:   - node_modules/@nuxt/cli/dist/cli.js
  2021-03-20T09:08:20.116880+00:00 app[web.1]:   - node_modules/nuxt/bin/nuxt.js
  2021-03-20T09:08:20.116881+00:00 app[web.1]:   at Object.&lt;anonymous&gt; (api/routes/applications.js:5:17)
  2021-03-20T09:08:20.116881+00:00 app[web.1]:   at Generator.next (&lt;anonymous&gt;)
  2021-03-20T09:08:20.116882+00:00 app[web.1]:   at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
  2021-03-20T09:08:20.116882+00:00 app[web.1]: 
  2021-03-20T09:08:20.122522+00:00 heroku[router]: at=info method=GET path=&quot;/robots.txt&quot; host=application.temps4care.co.uk request_id=ec0a765b-e6be-4df1-9b72-c52e99f51c89 fwd=&quot;41.237.133.17&quot; dyno=web.1 connect=2ms service=14ms status=500 bytes=1199 protocol=https
  </code></pre>