[Vuejs]-Problem with production mode (Rails 5.2.4.1 + VueJS + Webpack 3.12 + Heroku)

0👍

Error comes from: document.body.appendChild(document.createElement('app'))

This creates an <app> node, not a <div id="app"> node, so later on the .$mount("#app") cannot effectively find the node.

Replace your document.createElement part with:

const app = document.createElement('div')
app.id = 'app'

document.body.appendChild(app)

That should do it.

Leave a comment