cli icon indicating copy to clipboard operation
cli copied to clipboard

`nuxi generate` + `ssr: true` = Firebase `predeploy` problem

Open bgrand-ch opened this issue 1 year ago • 1 comments

Hello,

Thanks for Nuxt!

"nuxt": "3.7.0"
"node": "18"
"pnpm": "8"

Context : I have a Firebase project and I use Firebase Hosting. In the firebase.json file, you can define hooks. I'm using the predeploy hook to generate the files for the showcase website created with Nuxt 3. I want to use the strength of Nuxt's pre-rendering.

Problem: To use Nuxt pre-rendering, I set ssr: true in the Nuxt configuration file and the nuxt generate command runs in the predeploy hook in the firebase.json file. The nuxt generate command with ssr: true never completes and so I'm stuck in predeploy without being able to go to the next step to publish the new content to Firebase Hosting.

Proposal: Add the --static parameter to nuxi build to be able to stop the command once all the files are generated and the payload pre-rendered. The complete command to use to solve my problem would therefore be nuxi build --prerender true --static true.

What do you think?

PS: I have other projects using Nuxt, but without the ssr: true. Generating files with nuxi generate is fine, but they are SPAs with no pre-rendered content.

Have a nice day.

bgrand-ch avatar Sep 03 '23 12:09 bgrand-ch

Hello,

For me, using "nuxi generate" requires the command to be stopped at some point. "nuxi generate" is regularly used for automatic deployments.

If I have understood correctly, using "nuxi generate" with ssr: true in the config file is allowed. This is the behaviour for generating static content with pre-rendered data. Correct? 🤔

bgrand-ch avatar Sep 25 '23 08:09 bgrand-ch