Skip to content
Advertisement

How to generate a static website out of Sveltekit official RealWorld example for hosting on google firebase?

https://realworld.svelte.dev/ is the official example of SvelteKit.
https://github.com/sveltejs/realworld is the codebase for this official example.

I am trying to generate a static site so I can host this on google firebase. I updated config as 

content of file svelte.config.js is

JavaScript

Content of file src/routes/+layout.server.js is

JavaScript

When I am trying to build using command npm run build I am getting error

JavaScript

What changes should I make to make it work?

Advertisement

Answer

The Realworld example is not really a good candidate for static site generation. Parts of it is hidden behind a login, and parts of it makes use of url.searchParams like your error suggests.

You could prerender parts of the site that fit all the criteria and server-side render the rest at runtime.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement