I want to build a client-side only application via Nuxt 3, and just as the docs describe here I've added ssr: false
to my nuxt config.
I then used the nuxi build
command to build the application, but it still says it needs to be run using node.
I proceed to run nuxi generate
as I would normally do for static hosting.
According to the output from the generate command, I should be able to just deploy the public folder to any static web hosting. However, when I do this, I just get a completely white page.
I have tried running the same commands without ssr: false
, and that does render a page, but that causes none of my javascript to work.
Edit: minimal reproducible example
So I've just follewd these steps from the nuxt docs.
Without making any code changes, except for editing my nuxt config, I've run generate
.
This is what my nuxt config looks like right now;
import { defineNuxtConfig } from 'nuxt'
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
ssr: false,
})
I then ran npx serve .output/public
as suggested in the comments, and that seemed to work just fine locally.
I then copied the public folder to my web server, but the same issue persists, just a white screen is visible.
Maybe I should clarify my question a little more: is it still possible to host a nuxt SPA, without running a node process on the server, just as it was before in nuxt 2?
Right now I just switched to a server rendered application, as I don't see another solution.