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?
As it turns out, we have to run npm run build:serverto generate the missing server.bundle file.
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>.