I'm afraid there's more.. An error pops up if the firebase-admin dependency in functions/package.json is greater than 7, so just set it to:
"firebase-admin":"^7.0.0"
Remember to:
cd functions && npm install
These solutions are hacky and this post might bite me in the future due to rapid changes in sapper and firebase stuff. But this got it working for me on Windows 10 using your repository. Regards!
Couldn't replicate error with firebase-admin version. Working fine with version 8.2.0, actually if I were to set it to 7.0.0, firebase throws an error.
npm start does work but as someone mentioned earlier, I also do not get styles and assets. No issues I think, because you don't really need npm start, just use npm run dev for development and npm run deploy when deploying to Firebase.
Finally, this does indeed look like a very half-arsed way to make Firebase deliver Sapper SSR, because I feel like it's one update from Firebase or one dependency away from breaking (at least on windows). So perhaps either thinking on a more stable way of implementing this or waiting for firebase for a proper Node.js server would be the way. Either way at least for now it works, though I'll probably stick with AWS for production runs.
Thank you very much @eckhardtd
for the tutorial! Have a great one!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hello!
Sorry for the delay. So here you go: gitlab.com/JoFont/sapper-firebase-...
The repo has a Readme with the same info I wrote in the first comment along with some images.
I'm running Windows 10. Thank you very much for you help, and have a great day!
Hi! No problem.
I just cloned your repo and holy ... is Windows copy and folder deletion a pain... Here's my solution (Also adding to post):
npm install -D rimraf mkdirp ncp
The -D flag adds it to dev dependencies, since that's where we need it. Change your scripts to this:
I'm afraid there's more.. An error pops up if the
firebase-admin
dependency in functions/package.json is greater than 7, so just set it to:Remember to:
cd functions && npm install
These solutions are hacky and this post might bite me in the future due to rapid changes in sapper and firebase stuff. But this got it working for me on Windows 10 using your repository. Regards!
Ok! So we do have success with your changes!
Some notes:
Couldn't replicate error with firebase-admin version. Working fine with version 8.2.0, actually if I were to set it to 7.0.0, firebase throws an error.
npm start
does work but as someone mentioned earlier, I also do not get styles and assets. No issues I think, because you don't really neednpm start
, just usenpm run dev
for development andnpm run deploy
when deploying to Firebase.Finally, this does indeed look like a very half-arsed way to make Firebase deliver Sapper SSR, because I feel like it's one update from Firebase or one dependency away from breaking (at least on windows). So perhaps either thinking on a more stable way of implementing this or waiting for firebase for a proper Node.js server would be the way. Either way at least for now it works, though I'll probably stick with AWS for production runs.
Thank you very much @eckhardtd for the tutorial! Have a great one!