Skip to content

Quasar SSR with Firebase Function #17237

@filiocorp

Description

@filiocorp

What happened?

I have spent quite a bit of time using quasar ssr with firebase, but no success after many days; I thought the best way to show you is to record my screen and show you what I have done. I would appreciate anyone taking a look at this:
My recorded screen

I also shared firebas.json; server.js, and functions/index.js for your reference. Any help would be appreciated.

firebase.json

server.js

import express from 'express'
import compression from 'compression'
import * as functions from "firebase-functions";
import {
  ssrClose,
  ssrCreate,
  ssrListen,
  ssrRenderPreloadTag,
  ssrServeStaticContent
} from 'quasar/wrappers'
export async function listen({ app, port, ssrHandler }) {
  if (process.env.NODE_ENV === 'development') {
    await isReady();
    return await app.listen(port, () => {
      // we're ready to serve clients
      console.log(`Server is listening on port ${port}`);
    });
  } else { // in production
    return {
      handler: functions.https.onRequest(ssrHandler)
    };
  }
}

functions/index.js

const functions = require("firebase-functions");
const ssrApp = require("./ssr/index.js");
exports.ssr = functions.https.onRequest(ssrApp);

What did you expect to happen?

I was expecting it to work seamlessly the way it works with port 3000.

Reproduction URL

https://github.com/filiocorp/quasar-firebase-ssr

How to reproduce?

I recorded my session and provided the instructions.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

SSR Mode

Platforms/Browsers

Chrome

Quasar info output

No response

Relevant log output

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions