nuxt generate SPA mode not working for dynamic routes when reloading/going to route directly

Versions

  • nuxt: 2.14.12
  • node: n/a

Reproduction

Additional Details

nuxt.config.js settings:

ssr: false

target: ‘static’

### Steps to reproduce
-Run ‘npm nuxt generate’

-Deploy to firebase hosting

-Dynamic routes are accessible when clicking on the links, but getting a 404 when accessing the URL directly or reloading the page.

-Cannot run nuxt generate everytime a new dynamic route gets created because these routes are user generated.

What is Expected?

Should be able to access dynamic route directly in SPA mode or reload the dynamic route page

What is actually happening?

Getting a Firebase 404 error, since the routes weren’t generated during build. (this is not a possibility since users will create content and they will get a new route to access the new content)

1 possible answer(s) on “nuxt generate SPA mode not working for dynamic routes when reloading/going to route directly