---
title: "Comment by Rohan Bagchi on \"Deploying MERN to Heroku (success)\" | Hashnode"
description: "I get the error Error: Cannot find module &#39;./dist/server.bundle.js&#39; . I checked the dist folder and no server.bundle.js was generated. Any idea what cou"
url: "https://hashnode.com/posts/deploying-mern-to-heroku-success/5737b4e8911fe184eb43bbb3/comment/589a0e7a93a28f88162ce19d"
---

[Discussion](https://hashnode.com/posts/deploying-mern-to-heroku-success/5737b4e8911fe184eb43bbb3)

Comment [Deploying MERN to Heroku (success)](https://hashnode.com/posts/deploying-mern-to-heroku-success/5737b4e8911fe184eb43bbb3)

[Rohan Bagchi](https://hashnode.com/@rbagchi)

[Feb 7, 2017](https://hashnode.com/posts/deploying-mern-to-heroku-success/5737b4e8911fe184eb43bbb3/comment/589a0e7a93a28f88162ce19d)

I get the error `Error: Cannot find module './dist/server.bundle.js'`. I checked the dist folder and no `server.bundle.js` was generated. Any idea what could be going wrong?

[Rohan Bagchi](https://hashnode.com/@rbagchi)

[Feb 7, 2017](https://hashnode.com/posts/deploying-mern-to-heroku-success/5737b4e8911fe184eb43bbb3/comment/589a0e7a93a28f88162ce19d#reply-589a134ab8c198c4787ea4f3)

As it turns out, we have to run `npm run build:server`to generate the missing `server.bundle` file.

[Rohan Bagchi](https://hashnode.com/@rbagchi)

[Feb 8, 2017](https://hashnode.com/posts/deploying-mern-to-heroku-success/5737b4e8911fe184eb43bbb3/comment/589a0e7a93a28f88162ce19d#reply-589aa89a3fb380655d72c58d)

Also, we need to update the `renderFullPage` function in `server.js`. The generated `js` & `css` is mapped by `manifest.json` as `"/main.css": "/app.<some_hash>.css"` and `"/main.js": "/main.<some_hash>.js"`. So, the style sheet reference in generated html should be updated to `<link rel='stylesheet' href='${assetsManifest['/main.css']}' />` and the `js` reference to be updated to `<script src='${process.env.NODE_ENV === 'production' ? assetsManifest['/main.js'] : '/app.js'}'></script>`.

Then run `npm run build:server` and deploy.

[Nick deLannoy](https://hashnode.com/@cosmicbuffalo)

[Jan 11, 2018](https://hashnode.com/posts/deploying-mern-to-heroku-success/5737b4e8911fe184eb43bbb3/comment/589a0e7a93a28f88162ce19d#reply-5a56ffc11a909b63185698a0)

Aha! Was finally able to deploy successfully after including these missing asset tags!
