Vue SSR Sub Routes


I have a need to create a server-side-rendered Vue.js app due to SEO and a large amount of dynamic content.

I have managed to get quite a bit done by following templates found online and some dynamic pages are working perfectly.

However, I am having a problem when using sub-level routes in vue-router as below.
path: “/blog/:category”,
name: “blog-category”,
component: Category
path: “/blog/:category/:post”,
name: “blog-post”,
component: Post

When navigating to these pages from within the site, everything works fine as there is no data-prefetching and all JavaScript assets are already retrieved.
However, when I refresh the site when I am on these pages, the JavaScript is never sent from the server to the client so no client side code is run and no dynamic content appears.

Again, this is only a problem when I use second-level routes and refresh the page, causing all assets to be rebuilt and delivered.
In the client-side console there is a 404 error because /blog/:category/:post/public/app.js isn’t found. In fact, there isn’t even an app.js located in the sources tab.

Any idea how I can implement sub-level routes in vue SSR or amend my server code to help this work?

I can send pretty much all of the code I have if necessary, but my hope would be that I am just missing something simple.

There’s a way to create server side rendering with vue easily.
It’s called nuxt.

I am aware of Nuxt but I would rather not use it so I can build my own router files and avoid the extreme opinion that Nuxt enforces, ie: this directive goes first, all props need a default value, etc.
I will likely be using Nuxt soon to accomplish this, but I would rather know how to make a custom site with my own routes, store modules, layouts, etc.

Just saying because Nuxt handles most of the issues you’re having already. SEO, handled, dynamic page rendering handled, routes handled. Give me a bit and I’ll try to figure out your issue. But I have to leave for a bit.

I greatly appreciate that!
I don’t mind Nuxt, I would just rather not use it if I could figure it out myself.