I have been trying to get my vuejs app to work with SSR, but all my attempts have failed. I really need some assistance with this.
It's important to note that I am using regular js files instead of .vue files with es6, and I'm requiring html templates using the webpack require function.
While the app functions perfectly in development mode, as soon as I try to execute it using 'vue-server-renderer' and navigate to any route, I encounter the following error:
Error: render function or template not defined in component: anonymous at normalizeRender (/Users/salaahassi/dev/vue/magicum/node_modules/vue-server-renderer/build.js:6015:13) at renderComponent (/Users/salaahassi/dev/vue/magicum/node_modules/vue-server-renderer/build.js:6081:3) at renderNode (/Users/salaahassi/dev/vue/magicum/node_modules/vue-server-renderer/build.js:6065:7) at render (/Users/salaahassi/dev/vue/magicum/node_modules/vue-server-renderer/build.js:6257:5) at RenderStream.render (/Users/salaahassi/dev/vue/magicum/node_modules/vue-server-renderer/build.js:6312:9) at RenderStream.tryRender (/Users/salaahassi/dev/vue/magicum/node_modules/vue-server-renderer/build.js:96:12) at RenderStream._read (/Users/salaahassi/dev/vue/magicum/node_modules/vue-server-renderer/build.js:125:12) at RenderStream.Readable.read (_stream_readable.js:348:10) at resume_ (_stream_readable.js:737:12) at _combinedTickCallback (internal/process/next_tick.js:74:11)
Furthermore, when I disable javascript on my browser, even the home page disappears (this is due to it not functioning from the SSR).
Below is my webpack configuration:
[webpack configuration code here]
And here is my server entry file:
[server entry file code here]
Finally, here is my server.js file:
[server.js code here]