3

I have been messing around with new Svelte SSR adapters since the future of Svelte will not use Sapper. I am trying to create a firebase function for SSR, but I can't seem to find any clue on how to do this.

This guide tells you how to implement Svelte so that it can use Firebase Functions. I have no problem there, but I do not see anywhere on how to setup the firebase function itself:

Installing Svelte@next

https://carlosvin.github.io/posts/svelte-next-bright-future-with-snowpack/en/

https://github.com/jthegedus/svelte-adapter-firebase

In my actual index.js or index.ts firebase function file, I do not know what to call. I am thinking something like this:

const functions = require("firebase-functions");

const next = require("./build/index.js");

exports.ssr = functions.https.onRequest(next);

I believe I am missing something so simple. Any ideas?


Sapper SSR Resources

Jonathan
  • 3,893
  • 5
  • 46
  • 77

1 Answers1

2

Author of the Firebase adapter here.

There was an update with SvelteKit that by default disabled the logging level the adapter was using to guide you through the process.

Please try the latest version of the adapter (0.5.0) with the caveat that SvelteKit is still in alpha so the adapter can be broken by updates there. svelte-adapter-firebase@0.5.0 was tested and working against @sveltejs/kit@1.0.0-next.49

jthegedus
  • 705
  • 1
  • 7
  • 16