In my Firebase Console, if I click on the link under "Hosting" the site seems to be loading just fine. For some reason, I'm not getting anything but html on my localhost:5000 when I run npm start.
Mm, difficult to say, do you have a repo maybe? Is your firebase.json set like in the article? And are your external css and image files in your static folder?
The issue in my browser console is that all of the asset urls are like so: http://localhost:5000/[firebase-project-name]/us-central1/ssr/global.css. They're all returning 404's.
Is there a location in the app where I should be defining that path?
One more thing, the command firebase init functions hosting didn't give me the hosting options in the console. I had to run firebase init hosting separately.
// We have to import the built version of the server middleware.
const { sapper } = require("./sapper/build/server/server");
const middleware = sapper.middleware();
I can't seem to replicate your problem, my urls are correct out of the box. I'll have to spend time finding the issue. I did however notice something else regarding versions of dependencies in the ./functions folder. It seems that I have to use the exact versions in package.json in functions here github.com/Eckhardt-D/sapper-fireb.... Strange. I'll explore. Sorry I don't have an off-the-cuff response.
I'm having the exact same issue as Mort. I'm using newest versions in the functions package.json, as I got an error trying to use firebase admin 7.0.0. Once built and uploaded it works fine, but on localhost:5000 the firebase project name and useast1 time zone stuff shows up in the urls and causes 404s.
In my Firebase Console, if I click on the link under "Hosting" the site seems to be loading just fine. For some reason, I'm not getting anything but html on my localhost:5000 when I run
npm start
.Mm, difficult to say, do you have a repo maybe? Is your firebase.json set like in the article? And are your external css and image files in your static folder?
repo: github.com/mortscode/sapper-firebase
The issue in my browser console is that all of the asset urls are like so:
http://localhost:5000/[firebase-project-name]/us-central1/ssr/global.css
. They're all returning 404's.Is there a location in the app where I should be defining that path?
One more thing, the command
firebase init functions hosting
didn't give me the hosting options in the console. I had to runfirebase init hosting
separately.works for me
const functions = require("firebase-functions");
// We have to import the built version of the server middleware.
const { sapper } = require("./sapper/build/server/server");
const middleware = sapper.middleware();
exports.ssr = functions.https.onRequest((req, res) => {
req.baseUrl = '';
middleware(req, res);
});
Hi Mort,
So sorry for the late reply. Have been taking a screen break.
Have you figured it out? I will look at your repo in my breaks.
Regards
I can't seem to replicate your problem, my urls are correct out of the box. I'll have to spend time finding the issue. I did however notice something else regarding versions of dependencies in the ./functions folder. It seems that I have to use the exact versions in package.json in functions here github.com/Eckhardt-D/sapper-fireb.... Strange. I'll explore. Sorry I don't have an off-the-cuff response.
I'm having the exact same issue as Mort. I'm using newest versions in the functions package.json, as I got an error trying to use firebase admin 7.0.0. Once built and uploaded it works fine, but on localhost:5000 the firebase project name and useast1 time zone stuff shows up in the urls and causes 404s.
focus-at's solution worked for me, I'm using latest firebase-admin. I suspect this is a problem with the baseUrl var
Hi,
Same issue here with latest versions. Any fix?
focus-at workaround worked for me as well.